02-06-2009 11:51 AM
I have a BlackBerry Curve (8310), on which I am testing a web-based app in the BlackBerry browser. My issue has to do with the "Back" button, and caching. How can I force the page which I go "back" to, to be re-requested from the web server? Right now, it appears to be using the cached content without any further requests to the server. I've added all of the recommended anti-caching headers, to no avail.
I also need this to work without requiring the user to modify their Browser configurations.
02-10-2009 09:52 AM
Please see the following link.
How To - Control Browser Caching
Article Number: DB-00017
04-16-2009 06:15 PM
I am seeing the same problem. The page is cached no matter what. I am testing by browsing to the page, closing the browser, disconnecting the network, and then opening up the browser and attempting to navigate to the original URL. The BlackBerry says:
"Thenetwork is currently unavailable, however an old version of the page you requested is available in the cache. Do you want to view the old page?"
Why is it asking me this??? The page should NOT be cached!!
For reference, here is the RAW HTML (and response headers):
HTTP/1.1 200 OK
Last-Modified: Thu, 16 Apr 2009 20:59:55 GMT
Date: Thu, 16 Apr 2009 22:14:20 GMT
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<META HTTP-EQUIV="Expires" CONTENT="0">
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-STORE">
<title>Expires Example Page</title>
THIS SHOULD <B>NOT</B> BE CACHED
05-15-2009 09:35 PM
The link is almost right. For your meta-tags you will need
<meta http-equiv="Cache-Control" content="no-store, no-cache, must-revalidate, post-check=0, pre-check=0" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
This has worked for me on the 8310
05-20-2009 10:48 AM
Hello. I have a similar problem but with the maps application. My custom application has two options to invoke the blackberry maps app. Whenever I back from BB maps and invoke it again, all the previous locations remain on the map.
Thanks in advance.
05-31-2009 09:26 PM
I've tried the suggestion from the Blackberry knowledge base and also the meta headers suggested above and it still isn't refreshing. Any further suggestions?
I'm testing on the Blackberry 9000 Simulator, 220.127.116.11.
Any suggestions would be appreciated.
06-01-2009 10:10 PM
06-01-2009 10:38 PM
Well, I think we are talking about two different problems here. One, how to make the browser to refresh the previous page when you press the Back buttom. As far as I know, this is not possible since the browser doesn't do any kind of roundtrip to the webserver when you prest the back button, no matter if it is a BB browser or a normal desktop browser.
The other problem is how to avoid that the browser shows you the cached version of a page, instead of doing a roundtrip to the web server to pick an updated version of that page. I tested all solutions mentioned in the post above and non of them seems to work, at least for my 8320 emulator.
But I found another approach here:
Just trying that right now to see if it works
06-01-2009 11:05 PM
To be clear, my test page DOES correctly refresh when you press the back button in both IE and Firefox.
The first three posts suggested that proper caching headers are a valid solution to the back button problem, because if the page isn't cached then the browser will go request a new version of it. That seems to be exactly what happens with my test page in IE and Firefox, and apparently gejimayu18 had it working on an 8310.