Another small win today.
#Oni, the single user federated instance based on #GoActivityPub, serves HTML and #ActivityPub content from the same URLs based on what the clients request.
Firefox was caching the responses without taking into consideration the Content-Type, and was serving the JSON instead of HTML if refreshing a page. Only today I was reminded of the Vary header and fixed the problem. Yay! 😁
I'm a little bit ashamed of myself that I've forgotten about it.
#Oni, the single user federated instance based on #GoActivityPub, serves HTML and #ActivityPub content from the same URLs based on what the clients request.
Firefox was caching the responses without taking into consideration the Content-Type, and was serving the JSON instead of HTML if refreshing a page. Only today I was reminded of the Vary header and fixed the problem. Yay! 😁
I'm a little bit ashamed of myself that I've forgotten about it.
Hypolite Petovan
•marius
•Hypolite Petovan
•marius
•Vary is supposed to contain a list of the headers that the proxy/user-agent need to take into account when constructing the hash key for storing resources. Usually it's just the URL, vary adds a new element in the matrix for each header that it includes.
Accept is a request header, so I suspect that a vary with it will have no effect.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Vary
Vary - HTTP | MDN
developer.mozilla.orgmarius
•Hypolite Petovan
•Hypolite Petovan
•marius
•I wonder if I gaslit myself, or I had different tests in my dev environment.
Hypolite Petovan
•marius
•I like this feature a lot in #oni:
https://marius.federated.id/outbox/1/object
Hypolite Petovan
•