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: 66
Registered: ‎09-14-2011
My Device: Simulator
My Carrier: Developer

Caching application assects

is it possible to cache the application assects??

Like local images, javascript files?

I have some common javascript files that are common through all the application life cycle.

Can i cache that javascript file and image files that i'm using in every page so that loading time can be decreased.

If i can, then can someone guid me in right path on how to cache the javascript and image files.

 

I encountered this page in API documentation

 

https://bdsc.webapps.blackberry.com/html5/documentation/ww_developing/rim_cache_element_1264486_11.h...

 

under aggressiveCacheAge it is given that "to cache items that are not governed by directives in the HTTP header"

 

By "not governed by directives in the HTTP header" i assumed that it means resources other than HTTP requests.

 

so i added

<rim:cache maxCacheSizeTotal="2048" maxCacheSizeItem ="256" aggressiveCacheAge="2592000" />

 to config file. I cant sense any difference in simulator. But will it help in real device?

because even 100ms in simulator can become like 1 second in real device.

 

Please correct me if i'm wrong about aggressiveCacheAge .

 


Contributor
Posts: 44
Registered: ‎12-01-2009
My Device: Not Specified

Re: Caching application assects

Based on the documenation you do have the right idea about aggressiveCacheAge.

 

What I would recommend is testing this out with a very simple application and devise a test where you simply remove the radio... and you should start leveraging the cache! (Just to make sure it is working)

 

This will have a significant impact on the performance of your RIA. 

 

Good luck

 

R

Developer
Posts: 66
Registered: ‎09-14-2011
My Device: Simulator
My Carrier: Developer

Re: Caching application assects

This doesnt changed the loading at all.

I think i'm doing it wrong. i just added the line

 

<rim:cache maxCacheSizeTotal="2048" maxCacheSizeItem ="256" aggressiveCacheAge="2592000" />

 into my config file and compiled it and checked it.

Do i have to add something in javascript to make the asswcts cached??

Is there any example that shows how to cache the application assects?

Contributor
Posts: 40
Registered: ‎05-12-2012
My Device: 9800
My Carrier: Virgin mobile

Re: Caching application assects

Did this ever get resolved as I am having a similar issue as my local images are not being cached and it is causing me really bad memory issues as these images are loaded over and over again into memory.