Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there any way to disable the cache on Google Chrome for certain aspects only, in such a way that images for instance remain cached but markup/js/css don't?

I'm working on a rather graphic intensive app, and the images when not cached add a good half a second to the loading time of the page, which is a pain if you need to constantly refresh to test code changes and unnecesary if these images don't change as often as the html/js/css does.

share|improve this question
add comment

1 Answer

in your webservers .htaccess put

 <FilesMatch "(?i)^.*\.(js|css)$">
    ExpiresActive On
    ExpiresDefault 0
 </FilesMatch>

This should ensure that JS and CSS files are not cached by your browser.

Then you should use mod_pagespeed ExtendCache on the web server too, feature. It will allow your images to be sent with the right header information.

Once this is done on your development server (or whatever it is) the CSS/JS files should re-download on each page load but images will only be re-downloaded if forced. Also, make sure your local cache size is nice and big in Chrome's Preferences (you can also simply turn the images off here which is what I'd do)

share|improve this answer
    
This could work, but I was hoping I could find a solution that doesn't involve changing the server configuration for the sake of making it easy switching back and forth between cached/partially cached/uncached, much like one can enable or disable the cache on the chrome dev tools. –  Mahn Mar 17 '13 at 2:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.