Solved

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

Posted on 2013-05-20
8
793 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
Comment Utility
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 82

Expert Comment

by:Dave Baldwin
Comment Utility
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
Comment Utility
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
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
Comment Utility
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
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
Comment Utility
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 108

Expert Comment

by:Ray Paseur
Comment Utility
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
Comment Utility
thanks
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now