Solved

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

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

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 54

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Joomla 2.5 shopping cart 7 23
DataTables + iCheck + pagination Issue 2 23
Javascript/JQuery - HtmlEncode (?) Ajax Result 1 37
alert(innerHTML); 8 18
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
This article discusses four methods for overlaying images in a container on a web page
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…
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…

777 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