cujojs / curl

curl.js is small, fast, extensible module loader that handles AMD, CommonJS Modules/1.1, CSS, HTML/text, and legacy scripts.
https://github.com/cujojs/curl/wiki
Other
1.88k stars 216 forks source link

IE10 Caching issue #202

Open gwpower opened 11 years ago

gwpower commented 11 years ago

I am using curl to manage a simple video viewer on a site but have come across a problem with IE10 on Windows 7 ( I have not tested Windows 8 )

I am using straightforward setup ( I think :-) )

curl(this.videoConfig, ['wire!js/config/ImageVideo']).then( RICHFX.jQuery.proxy(function(imageVideoSpec){ // handle functionality based on spec variable
}, this), function(e){ RICHFX.jQuery.Console.Warn("error:", error); RICHFX.jQuery.Console.Warn("stack:", error.get_stack()); } );

This is working quiet well except for a very specific issue on IE10

Clear cache to ensure a blank canva 1) load first page with viewer and the callback function is executed without an issue 2) load another page with viewer and the callback function does not execute

I assume that this is down to how IE10 handles cached files I am not seeing this issue on any other browser

Has anyone else come across this and have a way around it?

Thanks,

-Greg

unscriptable commented 11 years ago

Hey Greg,

Somebody else reported something similar with IE10 on Win7. Let me see if I can find it.

-- John

unscriptable commented 11 years ago

Also:

  1. are you using any other plugins besides the wire! plugin?
  2. which version of curl are you using?

Thanks

-- John

unscriptable commented 11 years ago

Issue #182 is the one I remembered. The issue was solved by repeated clearing of IE's cache which seems to be ultra-aggressive on Win 7? This seems to be a different issue, I'm guessing.

gwpower commented 11 years ago

Hi John,

Thanks for getting back to me.

I have run into caching issues on IE before and have found that a combination of using the 'Clear Browser Cache' followed by setting 'Always refresh from Server' in the cache menu will get around this.

In answer to your question the only other plugin that I rely on was 'dom'

After a lot of hit and miss I found a way around the problem I was having:

As I mentioned, I am using curl in a video viewer, I am also loading a separate zoom viewer which is using the same structure based on curl

The problem would show up when navigating to a 2nd page with the same setup that would end up getting files from browser cache because of the successful run in the first sample page

The problem was showing up because the first config was finished before the 2nd was requested, this was only occurring when browser cache was speeding up the execution time. With the first completely finished the 2nd call would not make it to the 'then' clause. I'm not sure whether IE was ignoring this call or if it was failing

It is not occurring in any other browser, so my fix has been, that for IE10 I cleanup curl before executing the 2nd viewer config load

if ( window.curl ) { try { delete window.curl; } catch(e) { window["curl"] = undefined; } }

This has solved my issue and allows the 2 configs to load consistently regardless of browser caching