DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

Easy way to force refresh of CSS, JS ?

Sort:
You are not authorized to post a reply.





New Around Here





    I am aware that I can update the CSS and JS file names with some sort of versioning scheme (i.e. myscript_20231018.js), but the DNN site I am supporting has 8+ layout template files. Therefore, I would like to avoid having to update multiple template files when I update the Javascript. Is there an easier way to force browsers to pull the latest CSS/JS changes other than this approach I mentioned above?






    Veteran Member





      You don't need to do anything to have a version appended to your static dependencies.  (This happens automatically via the underlying Client Resource Manager.)  This will always be the case, as long as you properly version your theme and install it using DNN's installer.  






      Veteran Member





        By the way, it looks more like this example:  

        example.com/Portals/_default/Skins/MyThemeName/scripts/MyCustomScript.js?cdv=123

        In the example above, the 123 number is incremented when you install the extension. You can also manually increment it using the Servers > Performance view in the persona bar.  






        New Around Here





          Thanks! This should be what I am looking for...did not realize this was a setting.






          Veteran Member





            Posted By ebaker on 10/18/2023 7:44 PM

            Thanks! This should be what I am looking for...did not realize this was a setting.

            Awesome... Happy to help!  🥳 

             






            New Around Here





              I am very happy that the staff responds so fast






              Veteran Member





                Posted By Naraize on 10/19/2023 9:43 AM

                I am very happy that the staff responds so fast

                What staff?  What are you referring to? 

                 






                New Around Here





                  Hard Refresh (Ctrl + F5 or Shift + Click Refresh):

                  Press Ctrl + F5 (Windows/Linux) or Shift + Click Refresh (macOS) in your web browser. This performs a hard refresh, forcing the browser to re-download all resources, including CSS and JavaScript.





                  Veteran Member





                    That response doesn't make any sense.  Naraize has been moderated until we can verify this is not a bot (or person using a bot).  

                    You are not authorized to post a reply.

                    These Forums are dedicated to the discussion of DNN Platform.

                    For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

                    1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
                    2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
                    3. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
                    4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
                    5. No Flaming or Trolling.
                    6. No Profanity, Racism, or Prejudice.
                    7. Site Moderators have the final word on approving / removing a thread or post or comment.
                    8. English language posting only, please.

                    Would you like to help us?

                    Awesome! Simply post in the forums using the link below and we'll get you started.

                    Get Involved