Answer the question
In order to leave comments, you need to log in
How to deal with static caching in Chrome browser
There is a bunch of nginx + tomcat.
Nginx has two locations configured to proxy requests to tomcat and a static context.
Location's for static content expires -1; and in all browsers except Google Chrome, static is not cached.
Maybe someone has already encountered this, how can I defeat the problem in chrome?
Answer the question
In order to leave comments, you need to log in
On one of the working sites, we are just intensively distributing JS informers, there are no caching problems with any browsers, a piece of the nginx config:
location ^~ /informers/ { ... expires epoch; if_modified_since off; add_header Last-Modified ""; }
We did so. There is a client version and when something changes in js files, the version increases. All files are connected according to this pattern: url?version={Version}
Cache won in all browsers
Regarding the layout versions, you were correctly answered. Even if you defeat Chrome, you still won't defeat squids and privoxy =)
I make it simpler, I form links like /file.js?123123123, where the number is the file change time in unixtime. no version or other perversions are needed, the file has changed, the file change time has changed, the link has changed.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question