Solved

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

Posted on 2016-08-15
4
72 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 6

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 52

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

This article will show, step by step, how to integrate R code into a R Sweave document
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

914 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now