Safari caches IFRAME src=

This just bit me again so I thought I would share it.

Safari is doing over-zealous caching of IFRAMEs.  Once it sees an IFRAME, it remembers the value of the src= option for the IFRAME with that name= or DOM ID and refuses to ever look at it again.  No matter what you change the src= to, it will load from the old destination.  This is very broken. The workaround is obviously to use a different name= or DOM ID for each refresh of the page. Appending the date to it (e.g. in Ruby: Time.now.to_i.to_s) does the trick nicely. Note that name takes preference over DOM ID. If the DOM ID changes but the name does not, you still get the old page. DOM ID is only used if the name= option is not present.

You must be logged in to post a comment.