I have a cache invalidation system in place, so I need to set the cache for css|js to never expire.
I tried this
location ~* \.(js|css)$ { # |png|jpg|jpeg|gif|ico
expires max;
#log_not_found off; # what's this for?
}
And this is what I see in firebug:
So as you can see, requests are still being made, though they only receive a 'not modified' response. But I want to avoid them entirely, is that possible?
Also, I've read that an expirires of more than 1 year is or will be considered invalid in the standard. Is that true?
Edit
Let me complete @DisgruntledGoat's answer:
- Normal access to the url, like clicking on a link or in the url bar + enter: cache works, only 1 request issued for that url, and 0 for the assets.
- F5 to reload: many requests issued, but you receive all '304 not modified' responses for the assets, so they are not downloaded
- ctrl + F5 to reload without cache: many requests, all '200 success', all the assets are downloaded again.