Answer the question
In order to leave comments, you need to log in
How can I implement clearing the cache at the request of the developer?
Hello!
As everyone knows, in the process of developing a web application, there are often changes on the page that are not immediately displayed in the browser due to the cache. I need to implement the process of clearing the cache without the participation of the client. I'm not asking me to give a ready-made solution, share a link where to read about it?
Answer the question
In order to leave comments, you need to log in
just automatically change the file name or add a version or timestamp, then each time for the browser it will be different files, for example:
<link href='style.css?v92' />
<script src='main.js?20160523'></script>
When changing in the js file, you need to change the name of the assembly file. The tools depend on the build process you are using. for gulp like gulp-manifest.
If we are talking about js caching, then, as mentioned earlier, it is necessary to add versioning of files when deploying to production.
If you want to force the update of the Angular templates, then there is a command for this.
You can write it when you start the app:
app.run(['$templateCache', function ( $templateCache ) {
$templateCache.removeAll(); }]);
1) correct nginx configuration for static files
2) fingerprint in the file name during deployment
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question