Removing A Particular File From Browser's Cache
Something I'm noticing while working with Flex more and more is that browsers (in particular Firefox) are quite aggressive when it comes to caching Flash (SWF) files. This can make testing more hassle than it need be at times.
To get round this I've been using a nifty little feature of HTTPWatch which lets you remove an object from the browser's cache - one or many at a time.
All you do is keep an eye on the HTTP requests for the page you loaded and look for the SWF. In the shot above it's the highlighted line. Notice the HTTP status for it is 304, whereby the server has told the browser nothing has changed. I know it has so I select Clear Cache for Selected URLs from the Tools menu and next time I load the page I get the newer version.
It's simpler than emptying the whole of the browsers cache by some other means, which can have undesirable side effects.
I know I go on about HTTPWatch quite a bit, which might look a bit suspicious to some, but it's one of the handful of tools I've come to rely on day-to-day.
In Firefox you should only have to do a CTRL-F5 to force a cache refresh for the site you are loading.
Hi Simon. The key word there is *should*. When I say aggressive I mean I've seen Firefox refuse to update SWFs even after a "power refresh", as you suggested.
I sometimes wonder if Ctrl-F5 actually does what it's meant to.
Jake
@ Simon - did you mean SHIFT + F5? That seems to do the job for me.
Also should mention, SHIFT + clicking the reload icon in IE seems to force a reload as well.
Scratch both of those and flip them around. Shift + Reload for FF, Shift + F5 for IE.
"Notice the HTTP status for it is 304, whereby the server has told the browser nothing has changed."
If the server said nothing changed then why would the browser reload it? At least from your example it sounds like a server issue, not a browser issue.
Peace,
Rob:-]
Now I am confused. I can't get Shift or Ctrl to work with F5 and/or refresh button. Sometimes they do sometimes they don't. Seems to be no pattern to it.