DNN Forums

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

Easy way to force refresh of CSS, JS ?

 8 Replies
 2 Subscribed to this topic
 19 Subscribed to this forum
Sort:
Author
Messages
New Around Here
Posts: 4
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?

Senior Member
Posts: 1607
Senior Member
MVP
MVP
You're an MVP!
New Poster
New Poster
Congrats on posting!

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.  

Senior Member
Posts: 1607
Senior Member
MVP
MVP
You're an MVP!
New Poster
New Poster
Congrats on posting!

By the way, it looks more like this example:  

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

In the example above, the <code>123</code> 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
Posts: 4
New Around Here

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

Senior Member
Posts: 1607
Senior Member
MVP
MVP
You're an MVP!
New Poster
New Poster
Congrats on posting!
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
Posts: 0
New Around Here

I am very happy that the staff responds so fast

Senior Member
Posts: 1607
Senior Member
MVP
MVP
You're an MVP!
New Poster
New Poster
Congrats on posting!
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
Posts: 0
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.
Senior Member
Posts: 1607
Senior Member
MVP
MVP
You're an MVP!
New Poster
New Poster
Congrats on posting!

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

These Forums are for the discussion of the open source CMS DNN platform and ecosystem.

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