users@glassfish.java.net

Question about caching

From: <glassfish_at_javadesktop.org>
Date: Fri, 22 May 2009 09:58:42 PDT

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