Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Developer
Posts: 189
Registered: ‎08-13-2008
My Device: Not Specified
Accepted Solution

Caching issues

Hello

 

I am carrying out a channel push and cache push of a website to the BB so that it can be accessed offline. The push includes images, webpages and js files.

 

When I close down the BB simulator and BES and reopen before 12 hours have passed, I can access all pages with no problems.

 

If however I test the website after 12 hours, I get a message - "The network 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"

  

I am not setting any cache control directives.

 

From what I have read in the documentation I thought that the pages and images would be cached for 29 days - " 

If an expiry time is not set explicitly for an item, the item is removed from the cache after 29 days."

 

The testing has been carried out on:

BES 4.1.4

simulators - 4.1.104.2.1, 4.2.2, 4.3.0

 

Does anyone know what is happening after 12 hours. Do I need to set some cache control directives?

 

Thanks

 

Andrew

 

BlackBerry Development Advisor
Posts: 15,814
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Caching issues

BlackBerry handheld software version 3.8 and higher caches browser push data for 12 hours.  Prior versions cache the data for 29 days.  Please see the following link for more information.

 

How To - Control the cache expiry date of pushed content
Article Number: DB-00437

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800878/800673/How_To_...

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Developer
Posts: 189
Registered: ‎08-13-2008
My Device: Not Specified

Re: Caching issues

thanks for your help.

 

Do you know if we are able to use the max-age header to set the cache expiry date.

 

Andrew

BlackBerry Development Advisor
Posts: 15,814
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Caching issues

Max-age should work in recent software releases.  Expires has been supported in all versions.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Developer
Posts: 189
Registered: ‎08-13-2008
My Device: Not Specified

Re: Caching issues

The date format in the document http://www.ietf.org/rfc/rfc2616.txt is stated as RFC 1123, but the BB doc gives and example as - Expires: Wed, 07 Sept 2005 08:00:00 GMT

The month has 4 characters, yet RFC 1123 months have 3 characters.

 

I tested the Expires with Sep instead of Sept and the cache push fails.

 

Can you verify the format of the date.

 

Thanks

 

Andrew

 

 

Developer
Posts: 189
Registered: ‎08-13-2008
My Device: Not Specified

Re: Caching issues

Sorry, please ignore that last post it does work with 3 chars for the month.

 

 

Andrew