Welcome to WebmasterWorld Guest from 54.147.220.66

Forum Moderators: ergophobe

Message Too Old, No Replies

can you force a browser refresh?

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

10+ Year Member



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)

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



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)

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



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)

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



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.