I
I
Ivan2020-02-04 11:05:26
Nginx
Ivan, 2020-02-04 11:05:26

How does server caching work?

Hello! Tell me how the browser will behave in such a situation.

  1. Suppose I have static content caching enabled on my site. The cache expiration date is 1 day.
  2. A user enters the site, surfs through it and leaves.
  3. After the end of his visit, I change the cache time to 10 minutes.
  4. After 1 hour, this user visits the site again.


Will he clear his cache?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Page-Audit.ru, 2020-02-04
@PageAuditRU

The cache will be cleared on the server. In the browser - will depend on the page caching policy.
The server caching policy does not affect browser caching in any way. These are two different caches. Therefore, the browser does not know anything about the principles of caching adopted on the server. The browser does not care how the web server stores data and where it gets it from. Therefore, a user who visits your site in an hour will receive a version of the file that was cached by the web server no earlier than 10 minutes before the browser requested this file.
In short, a user visiting your site at 12:00 pm will receive a file that is newer than the one created earlier than 11:50 am on the same day, provided that the browser does not cache the page.
I re-read it, and I am immersed in it. Is the web server properly configured to serve cache headers to the browser?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question