I mean, how does mod_cache, or varnish for that matter, not take into account the Accept or Content-type headers when caching something?
I mean "I want the html at this address", results in "here have this json because someone before you asked for the json". They are like "the server should have sent an Vary header". Yeah, but what if it doesn't? Shouldn't the cache, as the thing that is taking over serving content, serve the right content according to standard specifications?
And why doesn't the Location directive in Apache's config match with a path like you'd expect? So if you were to add a Vary header to the path /friendica, you can't because it's subject to rewrite rules. You would have to match /index.php?pagename=friendica. But that doesn't work for me either, probably due to the query string. I can only add the header to the whole site, like this:
and then finally mod_cache serves the correct content types. With a much larger cache.
BTW, the same problem existed on profiles and posts, that are served machine-to-machine as json and to a browser as html, but sometimes from the same address.
Gidi Kroon
in reply to Gidi Kroon • •I mean, how does mod_cache, or varnish for that matter, not take into account the
Accept
orContent-type
headers when caching something?I mean "I want the html at this address", results in "here have this json because someone before you asked for the json". They are like "the server should have sent an
Vary
header". Yeah, but what if it doesn't? Shouldn't the cache, as the thing that is taking over serving content, serve the right content according to standard specifications?Gidi Kroon
in reply to Gidi Kroon • •And why doesn't the
Location
directive in Apache's config match with a path like you'd expect? So if you were to add aVary
header to the path/friendica
, you can't because it's subject to rewrite rules. You would have to match/index.php?pagename=friendica
. But that doesn't work for me either, probably due to the query string. I can only add the header to the whole site, like this:and
and then finally mod_cache serves the correct content types. With a much larger cache.
BTW, the same problem existed on profiles and posts, that are served machine-to-machine as json and to a browser as html, but sometimes from the same address.