Streaming live at 10am (PST)

Force browser to load newest CSS and Interactions on exported site


#1

Hi!

I’m hosting a website I’ve exported from Webflow on Godaddy server and facing a problem each time I am updating styles on any page.

How do I force browser to get the latest version?

I’ve manually added CSS versioning code to one of the pages I was editing. Like that my CSS got updated, but all the new Interactions/Animations I’ve created are not updated. How do I force load Interactions and is there any better method for both CSS and Interactions. Thanks

<link href="css/normalize.css?version=3" rel="stylesheet" type="text/css">
<link href="css/webflow.css?version=3" rel="stylesheet" type="text/css">
<link href="css/gilbert.webflow.css?version=3" rel="stylesheet" type="text/css">

#2

OK, tweaking this code seems to be of help . Hopefully I am not creating issues with this?

<script src="https://code.jquery.com/jquery-3.3.1.min.js?version=3" type="text/javascript" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script src="js/webflow.js?version=3" type="text/javascript"></script>

#3

Webflow hosting automatically does cache busting stuff so you’ll always have the latest version. If you’re hosting elsewhere you can just append a new version number at the end of the external files.

e.g.:

js/webflow.js
js/webflow.js?v=1
js/webflow.js?v=2
js/webflow.js?v=3
...

#4

If your needing the newest versions for dev purposes then why not just use dev tools in your browser? Options include not caching content for example.


#5

I think radmitry’s concern here is that his clients/visitors will not see the latest version of the site?


#6

Yes, thats exactly the case. So adding version number to stylesheets and js scripts helps. Just wonder if it has any downsides apart from manually tweaking html?

Thanks :slight_smile:


#7

Nope


#8

@samilew is correct. As a dev, using a date time stamp as the version number can help. Especially when working with a team. Just a thing to consider.


#9

Nice tip. Thanks :slight_smile: