[webkit-dev] what's the difference between Cache and PageCache in WebCore?

Aneesh Bhasin contact.aneesh at gmail.com
Tue Feb 15 01:16:32 PST 2011


Hi,

My answers inline...
PS : am keeping webkit-dev in the loop - this information may be
useful for others as well - or if I am wrong somewhere, others may
correct me..

2011/2/15 付文彬 <fuwenbin2086 at 126.com>
>
> Thanks for your help!
>
>  I know the capacity of Resource Cache can be set according to method: Cache::setCapacities, but Page Cache can only  be set the number of pages in cache.
> Can you give me some suggestions for "limit the total memory used by Page Cache" ?

Yes, the page cache can only be set in terms of the number of pages-
due to the nature of data it stores, it will be difficult and
impractical to have a memory-size limit on it. Depending on the
content of page being stored in PAge Cache, the actual memory used
will vary.

> And you said  "low memory will come at an impact to the page-loading time." What does "page-loading time"  mean?

Imagine having the Page cache switched off - that means every time you
press the 'back' button, the HTML will be parsed,  DOM tree will again
have to be constructed followed by the usual process of attachement
etc. This will increase the time it takes to display the page onscreen
- this is the 'page loading time' penalty I was referring to in my
earlier mail. Similar argument will also apply to Resource Cache as
well.

Hope that helps..

Regards,
Aneesh

>
> At 2011-02-15 14:13:10,"Aneesh Bhasin" <contact.aneesh at gmail.com> wrote:
>
> Hi,
>
> Here's my understanding on this : There are two types of caches in WebKit : Page Cache and Resource Cache.
>
> Resource Cache as the name suggests is to hold raw (e.g. CSS, JS etc.) as well as decoded (e.g images) resources so that sites which share these resources do not need to go to the network or even the network cache for these resources. Of course, it also saves time spent in decoding of images. You can limit the capacity (of complete cache as well as live and dead resources) or turn it off completely.
>
> The other is the Page Cache which holds all the data structres used for rendering the tree (DOM tree, render tree etc.) - used mainly to quickly display the page during forward/backward navigation. Again, you can limit the total memory used by this cache...
>
> Depending on your use-case, you can fiddle with the setting of these caches - of course, low memory will come at an impact to the page-loading time.
>
> Hope that helps..
>
> Regards,
> Aneesh
>
>
>
> 2011/2/15 付文彬 <fuwenbin2086 at 126.com>
>>
>> I want to reduce memory use of webkit,what can I do?
>>
>>
>> _______________________________________________
>> webkit-dev mailing list
>> webkit-dev at lists.webkit.org
>> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>>
>
>
>


More information about the webkit-dev mailing list