Unfiltered HTML Widget Caching?

Unfiltered HTML Widget Caching?

This question is not answered

I'm currently developing a theme to be reused across a couple of blogs. Because of the reuse, I needed to make a couple pieces of content render from a shared data source. I managed to do this with some JSON in a js file(stored on Windows Azure) referenced with a <script> tag, some JQuery and the unfiltered HTML webpart.

This worked great, for a little while. Now, for some reason, when I change the JSON data in the js file, the widget doesn't render the proper HTML. I did some digging, and it appears that the server is injecting the script or caching the widget somehow. When I request the page from IE, if i look at it via the developer tools, I don't see the datasource.js file on the scripts tab. If I take a Fiddler trace during of the page load, I don't see the datasource file downloaded, even after flushing the browser cache. If I delete the datasource.js file, the HTML still renders. If I rename the datasource.js and change the reference, it works fine. (This isn't practical due to the reuse, and possible frequency of changes) Can someone give me some advice as to what might be going on. (I don't administer the platform) Thanks!

All Replies
  • This is on the 5.5 or 5.6 platform.

  • Is the javascript file coming through the Azure CDN?  If the Azure CDN caches the contents of files for up to 72 hours, so it may take that long for any updates to the file to be detected by your browser.  If it's not stored in the CDN, what are the cache headers returned when you request the file?  Some of those may be causing your browser to cache files for long periods of time - even after you update the javascript file.

  • To be honest, I'm not sure if it's using the CDN. It's not my account. I only have access to the blob stuff to store/manage files. If I browse directly to the file via the web URL, I can get to the updated file, although I'm in the eastern USA. The account was created by a colleague in Australia, and I'm thinking the Telligent Server is on the West Coast of the USA. I updated the file on Thursday or Friday of last week, and it still isn't showing changes, so the 3 day suggestion doesn't seem like a reality in this case. I've tried different browsers on different machines with the same result. I just updated the http header for the file to be no-cache, so we'll see if that helps.

  • I just found something new. If I look at the source code of my page, specifically at where the JavaScript should be, I see something interesting. It looks like the blogging platform is doing some work to reduce/minimize the script, and hence it must be caching the data somewhere along the way. Is there a way I can tell the platform to ignore the minimizing/reducing action for script or widget?

    This is what I see in the source of the page.

    <script src="i1.blogs.msdn.com/.../85cd8a8151dcbe9f36dfb6a3d9270f5b-4e8d266d9f4a463145743a432dcc6fbc-RequestReducedScript.js" type="text/javascript"></script>

    It should be this.

    <script type="text/javascript" src="mspfeassets.blob.core.windows.net/.../script>

  • How are you referencing the script?  From what I'm seeing, it looks like you may have uploaded a copy of the script rather than referencing the external one.

  • I'm just justing using a script tag with the type and src attributes populated. The forum didn't display it correctly.

    I think this has finally been solved. I talked to the guy who admins our platform, and when he saw the RequestReducedScript.js in there, it rung a bell. Apparently we're doing something to shrink file sizes, including JS.