Home Analyst Portal

clear cache

Oleg_OliinykOleg_Oliinyk Customer IT Monkey ✭
we made changes in the files custom.js, custom.css. And now we want the changes to take effect without cleaning the cache in all computers. We have custom.js?v820. How to make 'custom.js?v821', 'custom.css?v821'. In this way all computers download new files. I tryed change number of version in file 'version.json', but this way is wrong. How I can change version on the Sireson portal?


  • james_kleinschnitzjames_kleinschnitz Cireson Dev, Product Owner Advanced IT Monkey ✭✭✭
    @Oleg_Oliinyk What product are you referring to; Cireson SCSM Portal or The SCCM Portal?
  • Ryan_LaneRyan_Lane Cireson Support Advanced IT Monkey ✭✭✭
    I'm assuming the reference is to the Analyst Portal vs the ConfigMgr Portal (sorry if I assumed incorrectly).  There are multiple Versions.json files so you may not have updated them all to your custom value.  A quick search for "static-content" with an application like AstroGrep shows three results:
    1. C:\inetpub\CiresonPortal\Versions.json
    2. C:\inetpub\CiresonPortal\bin\Versions.json
    3. C:\inetpub\CiresonPortal\bin\Templates\Versions.json

    On updating all Versions.json files I found results immediately in my test environment:

    I would advise against making sweeping changes like this in your environment though just in case any features may rely on looking at the version of the portal installed now or in the future.
  • Ryan_LaneRyan_Lane Cireson Support Advanced IT Monkey ✭✭✭
    edited November 2018
    There are some very good points in that post, thanks @Brian_Wiest!  I believe Jerry's solution of updating the Cache-Control for that directory would be the safest solution:
    Thanks everyone for their suggestions. We're in final testing of a solution where we set the Cache-Control value to 8 hours on just the CustomSpace folder. This looks like its resolves our issues as it applies to our custom code without affecting the rest of the Cireson Portal application.

    Will keep you posted on how testing goes.

    Google has some nice documentation on using Cache-Control that I used to decide on what to set for the values in the HTTP Response Headers for my CustomSpace directory.

    Testing Custom Cache-Control

    1. I set Cache-Control for my CustomSpace directory in IIS:
    no-cache, public, max-age=86400

    2. Loaded the Portal with a cleared cache (notice custom.css size is 1.4 KB):

    3. Refreshed page to show that custom.css is now only 215 B as the browser validates the cached content with IIS:

    4. Updated custom.css and immediately refreshed the page and we see that the browser downloaded the latest version of custom.css without any additional work on our end:

    I'm going to do a bit more testing but I think I'll be making this change in my production environment as well as this works perfectly for updating our custom content without having to run through a large number of hoops! Now, this won't go into effect immediately until the browser checks in with the server so it doesn't immediately solve @Oleg_Oliinyk's question but I think it is the most sound one.
Sign In or Register to comment.