ocLazyLoad icon indicating copy to clipboard operation
ocLazyLoad copied to clipboard

cache:false and double loading

Open MohamedAmineOuali opened this issue 7 years ago • 2 comments

Hello, First I wont to thank you for your efforts , it helps me a lot

I have read two issue about my problem but I can't find an answers for my question. I have a file that I should load without saving it to cache because it needs to run on every loading. When I use "cache:false" it all go fine but I have two identical file that are load to the browser. the problem is that I have same action that should not run twice when clique on the button so what should I do.

note: when removing cache:false the action work fine (only once). But I have problem loading the file when using the getback button and sometimes when making a refresh.

Thank you very much.

MohamedAmineOuali avatar Apr 19 '17 00:04 MohamedAmineOuali

I'm not a maintainer, but I'd be interested to look into your issue. Can you reproduce it via a jsFiddle?

If so, share it here, and we can check it out.

P.S. Did you see that a fix from way back was supposed to fix the cache busting and double run issue? https://github.com/ocombe/ocLazyLoad/commit/5a5d7f108578fe31c5ca1f7c8dfc2d3bccfd1106#diff-2eaedb8461ca33b78dcbfa62ccba7946R75

dgreene1 avatar Apr 24 '17 18:04 dgreene1

You can append query string before the url. so that based on the query string, the browser will check whether need to load or not. Cache should be true for this case

{
                  insertBefore: '#loadJsBefore',
                  name: 'fancyTreeJs',
                  files: [{ type: 'js', path: 'bundles/fancytree?v=' + version }]
              }

jeevasusej avatar Aug 28 '17 11:08 jeevasusej