E
E
Eugene2013-12-03 16:37:53
Nginx
Eugene, 2013-12-03 16:37:53

Is it possible to force the browser not to check the validity of the cache?

Is it possible to force the browser not to check the validity of the cache?
Even if the image is cached, the browser still sends a request to the north to check if it has changed.
The server responds with a 304 code
"GET /11345.jpg HTTP/1.1" 304
. Is it possible to make the browser not send requests to check cached files at all?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Eugene Mosyukov, 2013-12-03
@GeneMoss

Use the Cache-Control and Expires headers.

S
Sergey, 2013-12-03
Protko @Fesor

Actually this is the essence of the http cache. It sends requests to the server and if the content has not changed, it simply sends headers to it and does not try to send the file. This is still many times faster (time is minimized not only by reducing the number of packets, but also due to fewer calls to the FS).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question