I am developing Javascript for the website www.example.com, and Chrome saves caching of earlier versions of my code. I can constantly clear the cache, but it becomes a stream of time. Any other options?
Usually I press: ctrl + shift + r to clear the cache. This I consider the easiest.
This also works:
<meta http-equiv="no-cache"> <meta http-equiv="Expires" content="-1"> <meta http-equiv="Cache-Control" content="no-cache">
If you do not want to change the code of your web page. You can simply open the developer tools in Google Chrome. Shortcut: Ctrl + Shift + I on the windows.
In the lower right corner you will find a mechanism that will lead you to the settings. Check the "disable cache" box and you're good to go.
If you use an incognito window for debugging, it does not have cached data. Simple and does not require changes in your browser settings.
I do it myself for development. I am using CTRL-F5. This is like a power upgrade. This refreshes the page, including reloading any associated JS files or CSS files, even if they were cached.
Add these headers to your web pages during development:
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"> <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
Or you can configure the web server to add cache information to the http headers (during development).
you can add a rule in .htaccess for not caching a specific file or a specific extension
<FilesMatch "script.js$"> Header unset Cache-Control Header unset Expires Header unset Last-Modified FileETag None Header unset Pragma </FilesMatch>
or for all .js and css
<FilesMatch "\.(js|css)$">
Try setting the HTTP header:
Cache-Control: no-cache, no-store
Or:
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE, NO-STORE">
But this should only be used during development.
Source: https://habr.com/ru/post/891678/More articles:How to connect Mediawiki to a user database? - authenticationC ++ Name Mangling Library for Python - c ++jQuery $ .ajax WCF service call returns 400 Bad Request - jqueryCreating a custom data annotation check in MVC 3 - c #Is it possible to mark a module function as βhiddenβ from Intellisense detection? - c #Is there a good way for a built-in function to access private or internal values? - f #Parsing data from CSV to array in Java - javaRuby / Rails - dynamically create a table for a variable number of cells - ruby ββ| fooobar.comChange ScrollBar background color in ScrollViewer wpf - c #Performing Historical Buildings Using Mercurial - dateAll Articles