Firefox caching iframe data

Ok this is a repost cuz of stinkin’ DreamHost.

If you have an auto-generated iframe from a javascript, and this iframe has dynamic data, FireFox (but not IE) wll cache your data. Even if you have

<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<
META HTTP-EQUIV="Pragma" CONTENT="no-cache">

After days of pulling out my hair (or what little I have left), i found out the only way around this is by calling this in your JavaScript:

iframe.src = iframe.src;

This basically forces the browsers to reload. Not the most efficient solution but it works. Also, I haven’t tested to see if I could remove this with FireFox 3 coming out but no matter. The rest of the world is gonna take 1-2 years to download FF3 anyway.

PS: Hairloss is not due to masturbation. Thank god for that.

Sign Up for My Newsletter
Like what you read? Join my newsletter.

As an added bonus, I'll send you an ebook that shares my secrets on how I boosted my customers sales lead generation activity by 2400% percent. For a limited time, I'm sharing this ebook for those who sign up for my awesome newsletter.
In the ebook, you'll learn
  • 4 common mistakes that cost companies thousands of dollars
  • 3 simple tactics to boost your referral rate by up to 200%
  • Step by step copywriting style that will make your brand stand out
This is STRICTLY a limited time offer, so GET your copy NOW

100% privacy, I will never spam you!
Firefox caching iframe data by

taewoo

Ex-code monkey turned entrepreneur, marketer, blogger, and speaker. TaeWoo writes about online marketing and growth hacking. You can read more about him here.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle Plus

8 Comments

  • Alien Y September 22, 2008 at 3:36 am

    hello, I have the same problem,
    do you have full code about this ?

    thanks.

  • taewoo September 23, 2008 at 12:48 pm

    Hey Alien Y.
    I basically posted the solution.. read again

  • QDawg December 3, 2008 at 7:02 pm

    I have a similar issue, only my iframe is dynamically passing data to the parent frame. Any idea how I can prevent the iframe from passing that data before it is loaded.

  • taewoo December 11, 2008 at 1:06 pm

    QDawg: You can try “onload” function within the iframe.

  • Son Nguyen June 1, 2009 at 12:38 pm

    I experience the same with FireFox 3, even with the src refresh/force. But the weird thing is enable Firebug (a Firefox add-on) and the problem goes away. But can’t expect any regular visitors to install Firebug. I guess Firebug does alter the data loading sequences. Any clue?

  • Colin June 17, 2009 at 9:24 am

    Thanks so much! I modified thickbox to deal with this

    thickbox.js around like 197:

    }else{//iframe modal
    $(“#TB_overlay”).unbind();
    $(“#TB_window”).append(” “);
    // fix for firefox iframe caching
    var iframe = $(“#TB_iframeContent”)[0];
    iframe.src = iframe.src;
    }

  • Margaret October 1, 2010 at 5:02 pm

    Dear God, thank you for taewoo

    • taewoo October 3, 2010 at 10:15 am

      yes, i am sent from God. ;)

One Trackback

  • By Firefox IFRAME caching on August 22, 2009 at 2:00 am

    [...] is a great post on the internet that gives a work around for iframes that are being cached. In my situation [...]

Post a Comment

Your email is kept private. Required fields are marked *

x
Like this Post?

Let me know what you like by Liking, Tweeting, and +1'ing it so I write MORE of what you like: