Z
Z
Zamorozka2011-12-11 14:59:34
Nginx
Zamorozka, 2011-12-11 14:59:34

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

5 answer(s)
V
Vitaly Peretyatko, 2011-12-11
@Zamorozka

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 "";
}

P
Pavlo Ponomarenko, 2011-12-11
@TheShock

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

V
Vlad Zhivotnev, 2011-12-11
@inkvizitor68sl

Regarding the layout versions, you were correctly answered. Even if you defeat Chrome, you still won't defeat squids and privoxy =)

K
Konstantin, 2011-12-11
@Norraxx

ctrl + shift + delete or press F5 twice, it helps me.

A
Anton Taraev, 2011-12-13
@ataraev

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 question

Ask a Question

731 491 924 answers to any question