users@glassfish.java.net

RE: Question about caching

From: Martin Gainty <mgainty_at_hotmail.com>
Date: Fri, 22 May 2009 14:01:39 -0400

Hello Peter
check the attributes for element 'cache' element in sun-web.xml specifically

max-entries 4096 //MORE THAN 1 !
(optional) Specifies the maximum number of entries the cache can contain. Must be a positive integer.

timeout-in-seconds 30 //if its too low the elements wont be cached
(optional) Specifies the maximum amount of time in seconds that an entry can remain in the cache after it is created or refreshed. Can be overridden by a timeout element.

enabled true //MUST be set to bool true
    
e.g.
  <cache max-entries="4096" timeout-in-seconds="600" enabled="true">

http://docs.sun.com/app/docs/doc/820-4502/beard?a=view

?
Martin
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Fri, 22 May 2009 09:58:42 -0700
> From: glassfish_at_javadesktop.org
> To: users_at_glassfish.dev.java.net
> Subject: Question about caching
>
> Hi Folks,
>
> I dont really understand how glassfish's cache works. I've got 2 webservices (Axis2) (getVideosByGenreIds and getTracksByGenreIds) the signatures are the same for them. The related mappings in sun-web.xml are:
>
> <cache-mapping>
> <timeout>86400</timeout>
> <url-pattern>/services/MediaService/getTracksByGenreIds/*</url-pattern>
> <key-field name='startPage' scope='request.parameter'>
> </key-field>
> <key-field name='genresIds' scope='request.parameter'>
> </key-field>
> <key-field name='maxResults' scope='request.parameter'>
> </key-field>
> <key-field name='orderByColumn' scope='request.parameter'>
> </key-field>
> <key-field name='orderByDir' scope='request.parameter'>
> </key-field>
> </cache-mapping>
>
> and
>
> <cache-mapping>
> <timeout>86400</timeout>
> <url-pattern>/services/MediaService/getVideosByGenreIds/*</url-pattern>
> <key-field name='startPage' scope='request.parameter'>
> </key-field>
> <key-field name='groupIds' scope='request.parameter'>
> </key-field>
> <key-field name='maxResults' scope='request.parameter'>
> </key-field>
> <key-field name='orderByColumn' scope='request.parameter'>
> </key-field>
> <key-field name='orderByDir' scope='request.parameter'>
> </key-field>
> <key-field name='recursive' scope='request.parameter'>
> </key-field>
> </cache-mapping>
>
> So I suppose that all these 2 webservices should be cached by Glassfish, but I dont know why only getTracksByGenreIds is cached, getting the other one's result takes much time (the response's size is 10K)
>
> I'm not familiar with Galssfish, I thought that when I set a cache mapping for an url pattern and the result becomes cached and when the next request is arriving the result xml is served for it from cache(without any calculating or any backend process executing).
> Could you please help me or explain me what the rules of caching are or what the caching mechanism is or what wrong with my sun-web-xml is?
>
> All Best,
> Peter
> [Message sent by forum member 'nadasipeter' (nadasipeter)]
>
> http://forums.java.net/jive/thread.jspa?messageID=347338
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>

_________________________________________________________________
Hotmail® has ever-growing storage! Don’t worry about storage limits.
http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage1_052009