/    Sign up×
Community /Pin to ProfileBookmark

A way to refresh pages once a day??

Not sure if this is the best place to post this…

Is there a way I can force users browsers to refresh my webpages once per day? I don’t want to force the pages to not cache at all, as there are some large graphics and they’re used on multiple pages. But I do want to be sure that my users are seeing the newest content without having to tell them at the top of the page to hit their refresh buttons to see the newest content! :rolleyes:

So, is there a script available that would make my pages reload automatically the first time my pages are accessed each day?

(a cut-and-paste script would be ideal, as I’m a total beginner to javascript)

Thanks,
Dawn

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@cassiadawnauthorMar 08.2005 — Won't that force the pages to reload on every view? I don't want that, I think it will slow load times down too much. I want it to force users to ignore the cache and reload once a day, then use the recached information until the next day.
Copy linkTweet thisAlerts:
@A1ien51Mar 08.2005 — I persoanally think it is a waste of time. BUT you could write a JavaScript function that set a cookie and reloads the page with a query string value to force it to get a new version.

basic idea, you can try to code it
<i>
</i>if cookie value date is &gt; 24 hours difference
window.location.href = window.location.href + "?x=" + Math.round((Math.random() * 200));
set cookie with current date


Look up on google setting cookies, getting cookies, and comparing dates.

I personally have my browser set up to look for a new version on every visit.

Eric
×

Success!

Help @cassiadawn spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...