logo

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.

ScreenShot001

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.

Comments

  1. In Firefox you should only have to do a CTRL-F5 to force a cache refresh for the site you are loading.

    • avatar
    • Jake Howlett
    • Wed 4 Mar 2009 07:28 AM

    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

  2. @ Simon - did you mean SHIFT + F5? That seems to do the job for me.

  3. Also should mention, SHIFT + clicking the reload icon in IE seems to force a reload as well.

  4. Scratch both of those and flip them around. Shift + Reload for FF, Shift + F5 for IE.

    • avatar
    • Rob
    • Wed 4 Mar 2009 12:30 PM

    "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:-]

    • avatar
    • Jake Howlett
    • Thu 5 Mar 2009 03:09 PM

    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.

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment:


About This Page

Written by Jake Howlett on Wed 4 Mar 2009

Share This Page

# ( ) '

Comments

The most recent comments added:

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Let's Get Social


About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

More Content