Solved

Forcing html page to load from server rather than cache - document.location.reload(true); ??

Posted on 2016-08-15
4
95 Views
Last Modified: 2016-08-15
I have a html page which is launched from a tab. I need this page to load from the server each time the tab is clicked - and NOT cache.
With my current set up I have to click the chrome browse button to get latest version of the page.

Researching the web I find that this is possible by embedding

document.location.reload(true);

into the document ??. The (true) forces the page to be loaded from the server.

However, as I am not that competent in j script  and html its not  clear to me how to build this into my html page.

Hopefully someone can help me.

Thanks
0
Comment
Question by:jameskane
4 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 41756151
Posting JavaScript questions in the Java TA is not appropriate, and might make your question less likely to be answered. http://technojeeves.com/joomla/index.php/free/127-javascript-is-not-java
1
 
LVL 8

Expert Comment

by:Mukesh Yadav
ID: 41756155
Try this ;)

You can send the header(cache control) from server to browser that instruct browser that page content not to cache.

Thanks,
Mukesh Yadav
0
 
LVL 55

Accepted Solution

by:
Julian Hansen earned 500 total points
ID: 41756158
You can add the following to your <head> section

<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"/>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Expires" content="0"/>

Open in new window

1

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Dynamic Dropdowns 15 32
Selecting Right Partition 6 68
How can in rewrite this js anonymous function as a named function 26 31
Do alert on select 6 13
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
The viewer will learn how to count occurrences of each item in an array.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question