Y
Y
yho862020-07-02 12:02:07
Nginx
yho86, 2020-07-02 12:02:07

How do I avoid having to clear the browser cache when I make changes?

If I make any changes on the site and restart nginx, then the changes will not be displayed on the site until I clear the browser cache.

The nginx config file is set to:

sendfile off;


Is there a way to make it so that I don't have to clear the cache every time I make a change?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
ky0, 2020-07-02
@ky0

To say in the headers of the returned resources that they cannot be cached (a bad way), or to give different urls for files when changes are made, attaching to them, for example, a type parameter example.com/style.css?v=2020070201.
Z.Y. - nginx needs to be restarted in extremely rare cases, use reload.

L
lagudal, 2020-07-03
@lagudal

Are you trying to solve the problem on the front (browser) side on the side of the backend (server)? Why restart ngnix? Discover browsersync, in conjunction with gulp for example.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question