How to constantly deploy a web application with caching enabled?

In our web application, we have a web page that includes many components, each of which is processed by data from the database, the cache server is used to store the generated components for future requests. And we also saved the global “last modified” timestamp for the entire page, which was last modified for any data (in the database) on this website, and we return a 304 HTTP response if the browser cache has a new version.

In short, to improve performance, we use a cache server and a client-side cache server.

This is all good until we consider deploying new code. When new code is deployed (e.g. html), not only the client-side cache is invalid, server-side caching should also be cleared. We need to set the time of the last change in the deployment time of the code and clear everything in the cache on the server side. This is not entirely desirable if we regularly implement the code. Since the data in the database for the page does not change regularly, we expect caches to work for a long period of time. But deploying new code hits our target.

What should we do in this case? Is there a "best practice" here?

+4
source share
1

, , css, , . ,

<link href='default.css?1' type='text/css' rel='stylesheet'>

, , , .

0

Source: https://habr.com/ru/post/1534873/


All Articles