9 Replies Latest reply on May 19, 2017 1:22 AM by itsgowtham

    Extension caches iframe content

    JeffW. Level 1

      hi,

       

      I'm using an iframe in my HTML5 extension to load an external page,

      which includes javascript files.

      When these are changed on the server and I re-open the panel or even re-start Premiere, the old js

      is being cached.

       

      I believe the exact same problem was describe here

      Photoshop HTML5 extension caches iframe all the time

      but no answer,

       

      I tried some common tricks like adding a timestamp to the url

      or clearing the iframe's src at startup, but no luck.

       

      Is there a way to clear the cache of an extension?

       

      thanks,

      Jeff.

        • 1. Re: Extension caches iframe content
          Hallgrimur Bjornsson Level 3

          Hi,

           

          You should be able to disable the cache entirely - per extension using this Chromium parameter: -disable-application-cache

          In your manifest file, add:

           

           

          </CEFCommandLine

           

          Best regards,

          Hallgrimur

          --

          Hallgrimur Th. Bjornsson | CCE Product Manager - Enterprise  Dashboard - Extensibility| Adobe | Tel: +44 (0) 1314582787

          • 2. Re: Extension caches iframe content
            weiguo@adobe.com Adobe Employee

            Jeff,

             

            What would happen if you load your HTML (with iframe) in Chrome browser? Does Chrome cache iframe content?

            • 3. Re: Extension caches iframe content
              JeffW. Level 1

              Thanks, Hallgrimur's code was cutt of, see the attachment on what to add and where I added it: inside the DispatchInfo tag.

              Screen Shot 2014-07-09 at 12.17.48.png

              Also, I only have this problem

              with our third party payment partner, not when I did a test

              with another website. So we need to look into that on our side.

              • 4. Re: Extension caches iframe content
                JeffW. Level 1

                sorry, my previous post was based on testing it incorrectly.

                 

                Adding the --disable-application-cache does NOT work for me in the extension.

                 

                Files (i only tested js files, but with loading different html pages/urls) are still being cached. I see the old file when I look it up in the Resources of the cef remote debugger.

                When I click the file, which takes me to the real url's source, I see the updated file.

                 

                I also tested loading the same page in an iframe in the browser. There's no problem there,

                it updates fine.

                • 5. Re: Extension caches iframe content
                  Zhihong Chen Level 1

                  Hi Jeff,

                   

                  Could you please try adding “nodejs-disabled="true"” into your iframe label and check this issue again (Just a try)?

                  CEP integrates Node.js and it conflicts with some iframe function. We can disable Node.js in iframe to fix this kind of error:

                  Old Code Example:    <iframe id="testID"></iframe>

                  New code Example:   <iframe id="testID" nodejs-disabled="true"></iframe>

                  • 6. Re: Extension caches iframe content
                    JeffW. Level 1

                    Thanks Zhihong,

                     

                    I already tried that, and I've just tried it again,

                    but js file is still being cached,

                    even after re-opening the panel and also restarting Premiere.

                    • 7. Re: Extension caches iframe content
                      Zhihong Chen Level 1

                      Hi Jeff,

                       

                      Thank you for reporting this. I made a simple test extension (shared here), set up a local server to try this, but failed to reproduce this error. In file CEP_HTML_Test_Extension-5.0\html\HTMLFeatures.html, there is a <iframe> label that points to web page index.html (in folder Server_pages). Index.html contains a JavaScript file myscript.js which outputs current time to front page.

                      Every time I reload the HTML Test extension, current time could be updated in the “HTML Features” page. My platform is Windows7 64-bit.

                       

                      Can these test extension and server pages simulate your issue? If so, could you please try it on your local machine and check whether we see the same result or not? Thanks!

                       

                      PS. CEP cache path is:

                      • Windows: C:\Users\USERNAME\AppData\Local\Temp\cep_cache\

                      • Mac: /Users/USERNAME/Library/Logs/CSXS/cep_cache

                      There is no CEP API to clear cache now.

                      • 8. Re: Extension caches iframe content
                        chrisperrella Level 1

                        Hey Zhihong,

                         

                        I have written a html panel with a webgl component. I am loading some images through JS into my webgl. Unfortunately they are currently being cached 100% of the time.

                         

                        Is there a way I could get ahold of your project you posted to see if I can have my images never cache?

                         

                        Thanks

                        Chris

                        • 9. Re: Extension caches iframe content
                          itsgowtham Level 1

                          Hi Jeff,

                             I also come through this issue (JS caching) but I have added the timestamp to JavaScript src. After that js is not caching.

                           

                          <script src="hw.js?d=<%=DateTime.Now.Ticks%>" type="text/javascript"></script>

                           

                          Thanks,

                          Gowtham