Welcome to WebmasterWorld Guest from 54.196.208.187

Forum Moderators: open

Message Too Old, No Replies

can you force a browser refresh?

     
11:47 pm on Nov 13, 2013 (gmt 0)

Preferred Member from US 

10+ Year Member

joined:May 6, 2004
posts: 650
votes: 0


I have a case where announcements can be posted in A module on a joomla site. Publishing the module then publishes the announcement.

The problem is that if the users browser is reading from a cache then they don't see the announcement.

Is there a way to force a browser cache refresh only when an announcement is published.. I'm thinking I could add JavaScript to the announcement module to do that

Thanks

Chris
12:58 am on Nov 14, 2013 (gmt 0)

Senior Member

WebmasterWorld Senior Member ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 25, 2002
posts:8632
votes: 279


I don't think you can do that with Javascript - that would be too much power over the client for a page to have. Things you can do that come to mind right away

1. Ajax refresh various elements of the page
2. set HTTP headers to stop caching
3. Add a query string with a hash so the browser has to fetch the page
4. meta tag no cache
5. a meta refresh if you want to go nuclear on them.
1:56 am on Nov 14, 2013 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:15504
votes: 749


Isn't this one of the things you can explicitly block in Firefox? So it can be done-- but doing it will probably not put you among the angels.
3:51 am on Nov 14, 2013 (gmt 0)

Senior Member

WebmasterWorld Senior Member ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 25, 2002
posts:8632
votes: 279


Not put you among the angels?

The only downsides are
- not cached so longer pageload for the client
- not cached, so more work for the server

But in the grand scheme those are not that big a deal unless this appears on tons of pages in a sidebar and you're going to go preventing caching sitewide.