![]() htaccess (os equivalnent) derective redirecting all requests to frameworks "index",īUT it the same time EXCLUDE files and directories requested by application directly. The problem with "annoying" cache in general layes in the framework :). Here is the link using which you can browse & download the rule if you have Requestly installed - ĭisclaimer: I built Requestly but I think this could be helpful to a lot of web developers and hence sharing here. You can keep this permanently ON and your browsing experience won't be affected too.The good thing is you don't need to keep your dev tools open for having this behavior.Here you can see that "Disable Cache" is not selected and still the resources are not loaded from Cache because of a random parameter (cb - Read it as Cache buster) in the URL. Requestly Query Parameter Rule to add random parameterĪfter adding the rule, JS/CSS files are not cached Rq_rand(4) is replaced by 4 digits random number when a request is made. Using Requestly Query Param Rule, you can add a param like this URL Contains /myresource.js The trick here is to add a query parameter to your resource with random value every time the request is made. Recently, I stumbled upon which helped me understand how you can disable cache for specific resources. Using Requestly Chrome Extension to disable Cache for particular resources (JS/CSS/Images, etc) It makes things slow and is inefficient if you want to disable cache for only 1-2 resources When you disable the cache, it is disabled for all the resources in that tab.You have to keep the DevTools Open and Disable Cache Selected. ![]() You can stop reading here if the solution discussed so far meets your use case. This works fine for local web development but there are certain limitations that I'd like to highlight. You can see that when I refreshed the page but didn't select the "Disable Cache" feature, almost all the resources were loaded from Cache. You can see that all the resources (I have filtered JS resources) have been fetched from network and not loaded from disk/memory cache. But now, you can find the "Disable Cache" feature in Network Tab in Chrome Dev Tools. When this question was asked, Chrome didn't support the Disable Cache feature. "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" –disk-cache-size=1 Right-click on the Chrome icon and select "Properties" in the context menu.Īdd following value to the path: –disk-cache-size=1 Deactivate Chrome cache by changing the shortcut properties If you copy the line, be sure to check, if the quotes are actual quotes.Ģ. chrom.exe" to this value: –disable-application-cache –media-cache-size=1 –disk-cache-size=1 - "%1"Įxample: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" -disable-application-cache –media-cache-size=1 –disk-cache-size=1 - "%1" Search for: HKEY_CLASSES_ROOT\ChromeHTML\shell\open\commandĬhange the part after. Open Registry (Start -> Command -> Regedit) There are two more options to disable page caching in Chrome for good:ġ. Read about the difference between the options to know which option to choose. If you do not want to use the Disable cache checkbox, a long press on the refresh button with the DevTools open will show a menu with the options to Hard Reload or Empty Cache and Hard Reload which should have a similar effect. Should you desire to disable the cache only for some resources, you can modify the HTTP header that your server sends alongside your files. Note that this will result in all resources being reloaded. Keep in mind, as a tweet from stated, this setting is only active while the devtools are open. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |