Render website everytime


(ioserg) #1

Hi, I’m using Hype alone to build websites, but an issue that I’ve had for a long time is that browsers save the website information.
How can I “tell” Hype to get the newest content every time a user loads a website?
Thanks


#2

Can you be a bit more clear here as in what “information”?

Generally, If you change a hype document and re-upload it, you should see the new content. The content is within Hype and it knows where the content is so you don’t really need to “tell” it as it has all the information built in on export in the form of the generated script.


#3

@ioserg

An alternate take to @DBear’s of your question:
Getting the page from the cache - or from the server (which would have the current state of the web page)…

What I’ve used in the past - in the “Head” of the HTML doc (where “0” = zero seconds):
<meta http-equiv="refresh" content="0">

The zero is an instant refresh, which is what You would want in your case.
If You used “15” it would refresh in 15 seconds.

Please also see:
window.location.reload(true);


Notes:
You can also use this technique as a redirect to another page, example here after “0” seconds (instantly):
<meta http-equiv="refresh" content="0; url=http://google.com">

Some entities such as the W3C discourage using the meta refresh as it “can disorient users”. What a specious argument. Any poorly designed web page can disorient users. As with all tools - use it properly.

Also, apparently browsers’ history (“Back” button) can have issues with redirects that are shorter than 5 seconds. I’ve never had a problem but this might be something to pay attention to.


(ioserg) #4

I’ve build over 20 websites using Hype, and whenever I update something and upload it, I have to clear the browsing data.


(ioserg) #5

Thanks a lot JimScott, I’ll try that :smiley:


#6

I recommend taking a look at the Network tab in Google chrome to see what information is being referenced from Cache (it’ll say ‘disk’ next to it), and what is being downloaded when you reload the page.

We do add a query string that in most cases asks the browser to redownload the generated .js file.

You might also be interested in how your server is telling browsers to cache images and JavaScript: