Solved

way to code for website or webpage to auto refresh without having to refresh? maybe htaccess

Posted on 2013-05-20
8
851 Views
Last Modified: 2013-05-24
i am updating webpages daily and my clients have to hit refresh to see the changes.
is there a way to auto refresh each time something is changed so that

when a user opens up the page, even if visited earlier that day, that it will refresh
with out having to click on refresh?

i have htaccess in place, but that does not help it.
maybe i have the wrong htaccess code.

thanks
0
Comment
Question by:webdott
[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
  • 2
  • 2
  • 2
  • +1
8 Comments
 
LVL 14

Expert Comment

by:quizwedge
ID: 39182567
While this one auto refresh on the page being changed, it will auto refresh the page every X seconds. See the second example at http://www.quackit.com/javascript/javascript_refresh_page.cfm
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39182628
The only way to make sure the page is current to stop it from being cached.  But when you stop it from being cached, it slows down browsing because the browser has to go back to the server for everything.  And 'htaccess' won't help because the browser may check the 'If Not Changed' status but 'htaccess' has nothing to do with that.

Info about cache parameters here: http://php.net/manual/en/function.header.php
0
 

Author Comment

by:webdott
ID: 39182630
thanks, but this will be annoying to the end user.

i may not have asked properly.

i have pictures and text, almost like a blog, on webpages that i change daily.
if a end user visited that page at 9:00am
i changed something at 10:00am
and they view it again at 11:00am, they will not see my changes unless they refresh the page

this deals with the browser cache of the webpage, i think it has something to do with the
Expiresby - timing in the htaccess code
i want it to show the updated info on the webpage just like blogs do, say in wordpress

thanks
0
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!

 
LVL 110

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 39182649
Try the meta-expires tag.  This works for me.  Put it in the document header.

<META http-equiv="Expires" content="Mon, 01 Jan 1990 01:00:00 GMT" />
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39182695
We understand very well what you are talking about because we are developers too and always have to deal with this.  Wordpress and other CMS's are not static pages in the first place, they are database driven.  Everytime you access a Wordpress site, it gets the content from the database and builds a new page.

I just was looking at my Wordpress blog to check the headers and when I went back to my home page, it didn't even make a request, just displayed it from cache.
0
 
LVL 14

Expert Comment

by:quizwedge
ID: 39182705
In that case Ray_Paseur's comment should work. May also want to check into pragma no-cache http://www.i18nguy.com/markup/metatags.html
0
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 39182708
The other thing you can do is render the web page entirely with JavaScript.  The JS will use AJAX calls to your server-side scripts and replace DIVs in the HTML document.  Then, even if the web page document is cached, the AJAX calls will still run and the fresh content will arrive.
0
 

Author Closing Comment

by:webdott
ID: 39195526
thanks
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn how to count occurrences of each item in an array.

691 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