private browsing and ctrl-f5 doesn't seem to be cutting it?

(i've got a lot of ajax loaded content)

link|improve this question
Duplicate: stackoverflow.com/questions/2263096/… – Pekka Mar 29 '10 at 10:44
feedback

migrated from stackoverflow.com Mar 29 '10 at 10:53

This question came from our site for professional and enthusiast programmers.

5 Answers

You can append the stylesheet URL with a query string to render the cache as no longer valid. For example, a version number.

<link rel="stylesheet" href="/css/style.css?1.1" type="text/css" />

This is assuming you are looking for a method to invalidate the cache for everyone. If you are simply looking to clear your own cache, this belongs on Super User.

link|improve this answer
feedback

Sometimes I hit ctrl-shift-delete, it prompts for things to delete, I delete the cache and sometimes the cookies. Then I hit F5.

link|improve this answer
feedback

Simple put some variable behind *.css. For example, ? and time() function.

link|improve this answer
I would avoid using time() as this would invalidate the cache on every page load. Unless the styles are being uniquely generated each time (why?), this is inappropriate outside of a development environment. – akamike Mar 29 '10 at 10:50
feedback

Stick a version number as a querystring to the CSS file:

<link href="/style.css?1" rel="stylesheet" />

Or if you want it to never be cached, stick something like the time there:

<!-- php -->
<link href="/style.css?<?=time();?>" rel="stylesheet" />
<!-- asp.net -->
<link href="/style.css?<%=DateTime.Now.Ticks%>" rel="stylesheet" />
link|improve this answer
feedback

You can also use the Firefox Webdeveloper addon. It has a function to disable your cache.

link|improve this answer
2  
Fantastic solution. 'Hey visitors, to use this site, you're gonna need Firefox and this addon and then go disable your cache!' – Charlie Somerville Mar 29 '10 at 10:52
feedback

Your Answer

 
or
required, but never shown

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