chrome cache removal for single files

Viewed 13165

recently I had to remove my entire cache to be able to view a webpage I was working on. This is fine I guess but it could be improved by removing specific pages from the cache. the chrome.browsingData.remove, seemingly has no option for indicating individual pages for removal. I was wondering if this could be done externally, but I am not familiar with the chromium code. I was also wondering if there are any planned changes to the chrome.browsingData.remove implementation. Many thanks

6 Answers

To remove a single file cache enter its URL into browser and do hard refresh.

If you're building the page dynamically, then during development, you can put a random string at the end of the URL used to load the script.

<script src="path/to/script.js?_=<%=Math.random()%>"></script>

This will cause a cache miss for that file but will use the cache for everything else (subject to cache-control headers and so on). Just remember to remove the parameter before pushing to prod!

UPDATE : 2019, April 20

Lately, I'm working with Chrome browser's inbuilt feature - Overrides. With this feature, we can write code for HTML, CSS, JS, etc directly in the console and see it on the web-page.

Here's a tutorial that might be helpful


Previous Answer :

I'm working with Google Chrome extension Resource Override.

After installing this extension, I'm overriding the resource which I want from the server instead of cache:

STEP #2 : Override the resource which you want fresh from the server:

enter image description here

⭐Important Note - Access the plugin from the developer-console instead of the browser

⭐⭐ I started with this approach but have moved to approach suggested by Lukas Greblikas in the answer above.

Good Luck...

Related