Solved

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

Posted on 2016-08-15
4
56 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
Comment Utility
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
Comment Utility
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 51

Accepted Solution

by:
Julian Hansen earned 500 total points
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

771 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

10 Experts available now in Live!

Get 1:1 Help Now