Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2016-08-15
4
Medium Priority
?
151 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 9

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 59

Accepted Solution

by:
Julian Hansen earned 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

610 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