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

x
?
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
?
915 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 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

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.

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn how to dynamically set the form action using jQuery.
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