Score:0

Apache: Setting cache headers by URL in htaccess

ro flag
228

I tried to use this solution, which seems to do what I want:

https://serverfault.com/a/995029/955515

I couldn't leave a comment on that answer, because I'm new and it says I need 50 reputation points to leave a comment.

I'm trying to add no-cache to the admin pages on a WordPress site. Here is what I tried:

<If "%{REQUEST_URI} =~ m#^/wp-admin/$#">
    Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
</If>

When I check the headers in Chrome DevTools > Network it shows images still have the same cache header as the frontend, and it says they are loaded from memory cache.

Does anyone know what I'm doing wrong? I used mod_expires to set all of the cache on the site not mod_headers. Is that the problem?

Apache v2.4.25

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.