?
Solved

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

Posted on 2013-05-20
8
Medium Priority
?
935 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
  • 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 84

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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 111

Accepted Solution

by:
Ray Paseur earned 2000 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 84

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 111

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

Technology Partners: 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

Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses
Course of the Month16 days, 8 hours left to enroll

862 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