Skip to main content


I'm at that point in the rabbit hole where I am disappointed in some widely used software.
in reply to Gidi Kroon

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?

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 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:

    <IfModule mod_headers.c>
        <Location "/index.php">
            Header merge Vary "Accept"
        </Location>
    </IfModule>

and

        CacheQuickHandler off

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.