SimpleCache plugin development issues

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

SimpleCache plugin development issues

Bakhtiyor Khodjayev
Hello, user.
   First, short response in "grails caching" question:
   
SimpleCache plugin add simple content and basic http caching
(ETag support) functionality (via servlet filter and ehcache).
Content is cached on URL basis and configured on (controller)
action basis (2 possible methods for now - controller static
field and annotation of action)

Example:
class SomeController {
   ...
   static simpleCacheConfig = [
       //ttl - cache time to live in seconds
       "cachedAction1" : ["ttl" : 600],
       "cachedAction2" : ["ttl" : 300]
   ]
   ...
   
   @SimpleCache(ttl=60)//ttl - cache time to live in seconds
   def cachedAction3 = {
       ....
   }
}
ETag support transparently added to all content generated by Grails.


--------------------------------------------------------


And few issues:
1. Is where any convention where to put some config files within
plugin infrascructure?

2. Grails sitemesh compabality problem
Content served from cache not handled by sitemesh filter. It's seems
that there are some "magic" hidden attributes in
context/request/response

3. How to contribute plugin into grails plugins SVN?






Plugin tested with RC-1-SNAPSHOT, it works, but there are still
some issues, I hope it will be released on weekends.
--
Regards,
 Bakhtiyor


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: SimpleCache plugin development issues

graemer
There is already a cache plugin in Grails plugins SVN as well as this one:

http://www.syrics.de/pages/page/show/Cacheable%20Plugin

Have you had a look at these?

I think we need to figure out some way to consolidate these different
plug-ins into one that is well documented and understood

Cheers

On 10/8/07, Bakhtiyor Khodjayev <[hidden email]> wrote:

> Hello, user.
>    First, short response in "grails caching" question:
>
> SimpleCache plugin add simple content and basic http caching
> (ETag support) functionality (via servlet filter and ehcache).
> Content is cached on URL basis and configured on (controller)
> action basis (2 possible methods for now - controller static
> field and annotation of action)
>
> Example:
> class SomeController {
>    ...
>    static simpleCacheConfig = [
>        //ttl - cache time to live in seconds
>        "cachedAction1" : ["ttl" : 600],
>        "cachedAction2" : ["ttl" : 300]
>    ]
>    ...
>
>    @SimpleCache(ttl=60)//ttl - cache time to live in seconds
>    def cachedAction3 = {
>        ....
>    }
> }
> ETag support transparently added to all content generated by Grails.
>
>
> --------------------------------------------------------
>
>
> And few issues:
> 1. Is where any convention where to put some config files within
> plugin infrascructure?
>
> 2. Grails sitemesh compabality problem
> Content served from cache not handled by sitemesh filter. It's seems
> that there are some "magic" hidden attributes in
> context/request/response
>
> 3. How to contribute plugin into grails plugins SVN?
>
>
>
>
>
>
> Plugin tested with RC-1-SNAPSHOT, it works, but there are still
> some issues, I hope it will be released on weekends.
> --
> Regards,
>  Bakhtiyor
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>


--
Graeme Rocher
Grails Project Lead
http://grails.org

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re[2]: SimpleCache plugin development issues

Bakhtiyor Khodjayev
Hello, Graeme.

> http://www.syrics.de/pages/page/show/Cacheable%20Plugin
> Have you had a look at these?

Yes, ant it's not fitted for me, so I decided create my own

There are differences into idea and implementation of
Cacheable Plugin and SimpleCache, so I think it's not
good idea to merge plugins.
You always have choice what to use.


On, Monday, October 8, 2007, 17:22:37:

> There is already a cache plugin in Grails plugins SVN as well as this one:

> http://www.syrics.de/pages/page/show/Cacheable%20Plugin

> Have you had a look at these?

> I think we need to figure out some way to consolidate these different
> plug-ins into one that is well documented and understood

> Cheers

> On 10/8/07, Bakhtiyor Khodjayev <[hidden email]> wrote:
>> Hello, user.
>>    First, short response in "grails caching" question:
>>
>> SimpleCache plugin add simple content and basic http caching
>> (ETag support) functionality (via servlet filter and ehcache).
>> Content is cached on URL basis and configured on (controller)
>> action basis (2 possible methods for now - controller static
>> field and annotation of action)
>>
>> Example:
>> class SomeController {
>>    ...
>>    static simpleCacheConfig = [
>>        //ttl - cache time to live in seconds
>>        "cachedAction1" : ["ttl" : 600],
>>        "cachedAction2" : ["ttl" : 300]
>>    ]
>>    ...
>>
>>    @SimpleCache(ttl=60)//ttl - cache time to live in seconds
>>    def cachedAction3 = {
>>        ....
>>    }
>> }
>> ETag support transparently added to all content generated by Grails.
>>
>>
>> --------------------------------------------------------
>>
>>
>> And few issues:
>> 1. Is where any convention where to put some config files within
>> plugin infrascructure?
>>
>> 2. Grails sitemesh compabality problem
>> Content served from cache not handled by sitemesh filter. It's seems
>> that there are some "magic" hidden attributes in
>> context/request/response
>>
>> 3. How to contribute plugin into grails plugins SVN?
>>
>>
>>
>>
>>
>>
>> Plugin tested with RC-1-SNAPSHOT, it works, but there are still
>> some issues, I hope it will be released on weekends.
>> --
>> Regards,
>>  Bakhtiyor
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>





--
Regards,
 Bakhtiyor                          mailto:[hidden email]


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: Re[2]: SimpleCache plugin development issues

JamesPage
bakhtiyor,

I think our cache plugin -- grails plugin is very simler to what you are doing. It is not the same as
Cacheable Plugin.

Take a look at http://docs.codehaus.org/display/GRAILS/Cache+Plugin

And code is in the grails plugin svn.

It is very near to been ready. All that needs doing is some tests from an outside server to check performance.  So far we have good results from a local server, but we have not tested each caching tecnique from a remote server.

The plugin works by creating virtual directories where your css/js/images are stored, and sets the expired header on them to the future, so that the browser/squid cache, caches them. When you change the underling file a new virtual folder is created so the  browser/cache believes that it has new file, and downloads the new copy.

The other features of the plugin (some more ready than others) is that it combines all your css and js into two files, and then optimises the files to reduce the file size. For JS files it uses JSmin and we are still working on the css reducer. 

The concept behind it is to get the browser, and or a squid proxy to do most of all work.

It follows the cache guidelines proposed by both yahoo with there yslow tool, and the google teams recommendation for increasing performance.

What needs testing is that each technique has a penalty on the first download, and a reward for subsequent downloads of a page, and we need to analyse that.

Is there anybody out there that could help us on the testing, and a server to test the code against?

All the best

James



On 10/8/07, Bakhtiyor Khodjayev <[hidden email]> wrote:
Hello, Graeme.

> http://www.syrics.de/pages/page/show/Cacheable%20Plugin
> Have you had a look at these?

Yes, ant it's not fitted for me, so I decided create my own

There are differences into idea and implementation of
Cacheable Plugin and SimpleCache, so I think it's not
good idea to merge plugins.
You always have choice what to use.


On, Monday, October 8, 2007, 17:22:37:

> There is already a cache plugin in Grails plugins SVN as well as this one:

> http://www.syrics.de/pages/page/show/Cacheable%20Plugin

> Have you had a look at these?

> I think we need to figure out some way to consolidate these different
> plug-ins into one that is well documented and understood

> Cheers

> On 10/8/07, Bakhtiyor Khodjayev <[hidden email]> wrote:
>> Hello, user.
>>    First, short response in "grails caching" question:
>>
>> SimpleCache plugin add simple content and basic http caching
>> (ETag support) functionality (via servlet filter and ehcache).
>> Content is cached on URL basis and configured on (controller)
>> action basis (2 possible methods for now - controller static
>> field and annotation of action)
>>
>> Example:
>> class SomeController {
>>    ...
>>    static simpleCacheConfig = [
>>        //ttl - cache time to live in seconds
>>        "cachedAction1" : ["ttl" : 600],
>>        "cachedAction2" : ["ttl" : 300]
>>    ]
>>    ...
>>
>>    @SimpleCache(ttl=60)//ttl - cache time to live in seconds
>>    def cachedAction3 = {
>>        ....
>>    }
>> }
>> ETag support transparently added to all content generated by Grails.
>>
>>
>> --------------------------------------------------------
>>
>>
>> And few issues:
>> 1. Is where any convention where to put some config files within
>> plugin infrascructure?
>>
>> 2. Grails sitemesh compabality problem
>> Content served from cache not handled by sitemesh filter. It's seems
>> that there are some "magic" hidden attributes in
>> context/request/response
>>
>> 3. How to contribute plugin into grails plugins SVN?
>>
>>
>>
>>
>>
>>
>> Plugin tested with RC-1-SNAPSHOT, it works, but there are still
>> some issues, I hope it will be released on weekends.
>> --
>> Regards,
>>  Bakhtiyor
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>





--
Regards,
Bakhtiyor                          mailto:[hidden email]


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re[4]: SimpleCache plugin development issues

Bakhtiyor Khodjayev
Hello, James.

It's seems that Cache Plugin serves well static content (or mayby I'm wrong?), and SimpleCache only dynamic content, so they compliment each other.

We can merge two plugins, we can don't merge.


Suggestion to sligtly improve Cache Plugin - adding ETag support (see http://www.infoq.com/articles/etags)




On, October 8, 2007, 19:08:06:

> bakhtiyor,

> I think our cache plugin -- grails plugin is very simler to what
> you are doing. It is not the same as Cacheable Plugin.

> Take a look at http://docs.codehaus.org/display/GRAILS/Cache+Plugin

> And code is in the grails plugin svn.

> It is very near to been ready. All that needs doing is some tests
> from an outside server to check performance.  So far we have good
> results from a local server, but we have not tested each caching tecnique from a remote server.

> The plugin works by creating virtual directories where your
> css/js/images are stored, and sets the expired header on them to the
> future, so that the browser/squid cache, caches them. When you
> change the underling file a new virtual folder is created so the
> browser/cache believes that it has new file, and downloads the new copy.

> The other features of the plugin (some more ready than others) is
> that it combines all your css and js into two files, and then
> optimises the files to reduce the file size. For JS files it uses
> JSmin and we are still working on the css reducer.  

> The concept behind it is to get the browser, and or a squid proxy to do most of all work.

> It follows the cache guidelines proposed by both yahoo with there
> yslow tool, and the google teams recommendation for increasing performance.

> What needs testing is that each technique has a penalty on the
> first download, and a reward for subsequent downloads of a page, and we need to analyse that.

> Is there anybody out there that could help us on the testing, and a server to test the code against?

> All the best

> James



> On 10/8/07, Bakhtiyor Khodjayev <[hidden email]> wrote:
> Hello, Graeme.

>> http://www.syrics.de/pages/page/show/Cacheable%20Plugin
>> Have you had a look at these?

> Yes, ant it's not fitted for me, so I decided create my own

> There are differences into idea and implementation of
> Cacheable Plugin and SimpleCache, so I think it's not
> good idea to merge plugins.
> You always have choice what to use.


> On, Monday, October 8, 2007, 17:22:37:

>> There is already a cache plugin in Grails plugins SVN as well as this one:

>> http://www.syrics.de/pages/page/show/Cacheable%20Plugin

>> Have you had a look at these?

>> I think we need to figure out some way to consolidate these different
>> plug-ins into one that is well documented and understood

>> Cheers

>> On 10/8/07, Bakhtiyor Khodjayev <[hidden email]> wrote:
>>> Hello, user.
>>>    First, short response in "grails caching" question:

>>> SimpleCache plugin add simple content and basic http caching
>>> (ETag support) functionality (via servlet filter and ehcache).
>>> Content is cached on URL basis and configured on (controller)
>>> action basis (2 possible methods for now - controller static
>>> field and annotation of action)

>>> Example:
>>> class SomeController {
>>>    ...
>>>    static simpleCacheConfig = [
>>>        //ttl - cache time to live in seconds
>>>        "cachedAction1" : ["ttl" : 600],
>>>        "cachedAction2" : ["ttl" : 300]
>>>    ]
>>>    ...

>>>    @SimpleCache(ttl=60)//ttl - cache time to live in seconds
>>>    def cachedAction3 = {
>>>        ....
>>>    }
>>> }
>>> ETag support transparently added to all content generated by Grails.


>>> --------------------------------------------------------


>>> And few issues:
>>> 1. Is where any convention where to put some config files within
>>> plugin infrascructure?

>>> 2. Grails sitemesh compabality problem
>>> Content served from cache not handled by sitemesh filter. It's seems
>>> that there are some "magic" hidden attributes in
>>> context/request/response

>>> 3. How to contribute plugin into grails plugins SVN?


>>> Plugin tested with RC-1-SNAPSHOT, it works, but there are still
>>> some issues, I hope it will be released on weekends.
>>> --
>>> Regards,
>>>  Bakhtiyor


>>> ---------------------------------------------------------------------
>>> To unsubscribe from this list please visit:

>>>     http://xircles.codehaus.org/manage_email


> --
> Regards,
> Bakhtiyor                          mailto: [hidden email]


> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:

>     http://xircles.codehaus.org/manage_email 





--
С уважением,
 Bakhtiyor                          mailto:[hidden email]


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: Re[4]: SimpleCache plugin development issues

JamesPage
Merging them would be great. It was always the plan to add dynamic content at later stage.

There was a reason for not adding etags and that was because as at this stage we are dealing with static content and what we are trying to do is stop the server getting hit at all, and therefore we went down the road of setting the expires header. Adding an ETAG would mean that the browser would check to see if the content has been modified. "If you're not taking advantage of the flexible validation model that ETags provide, it's better to just remove the ETag altogether. The Last-Modified header validates based on the component's timestamp. " see http://developer.yahoo.net/blog/archives/2007/07/high_performanc_11.html

For dynamic content etags would be great. But I would not use the RAILS model, which is to process the request and then to calculate an etag based on the response, as the server has still do all the processing. The better model would be to calculate the etag on a unique hash of request parameters, as then the server could very quickly calculate if the request is the same as previous request. This has a gotcha and that is if the same request does not result in the same result.

For example I if my request is x=2 and y =3 and my response is 5, this method will work. But if another request is modifiable by another domain then the we need some mechanism to work out if this domain has been modified.

All the best

James

On 10/8/07, Bakhtiyor Khodjayev <[hidden email]> wrote:
Hello, James.

It's seems that Cache Plugin serves well static content (or mayby I'm wrong?), and SimpleCache only dynamic content, so they compliment each other.

We can merge two plugins, we can don't merge.


Suggestion to sligtly improve Cache Plugin - adding ETag support (see http://www.infoq.com/articles/etags )




On, October 8, 2007, 19:08:06:

> bakhtiyor,

> I think our cache plugin -- grails plugin is very simler to what
> you are doing. It is not the same as Cacheable Plugin.

> Take a look at http://docs.codehaus.org/display/GRAILS/Cache+Plugin

> And code is in the grails plugin svn.

> It is very near to been ready. All that needs doing is some tests
> from an outside server to check performance.  So far we have good
> results from a local server, but we have not tested each caching tecnique from a remote server.

> The plugin works by creating virtual directories where your
> css/js/images are stored, and sets the expired header on them to the
> future, so that the browser/squid cache, caches them. When you
> change the underling file a new virtual folder is created so the
> browser/cache believes that it has new file, and downloads the new copy.

> The other features of the plugin (some more ready than others) is
> that it combines all your css and js into two files, and then
> optimises the files to reduce the file size. For JS files it uses
> JSmin and we are still working on the css reducer.

> The concept behind it is to get the browser, and or a squid proxy to do most of all work.

> It follows the cache guidelines proposed by both yahoo with there
> yslow tool, and the google teams recommendation for increasing performance.

> What needs testing is that each technique has a penalty on the
> first download, and a reward for subsequent downloads of a page, and we need to analyse that.

> Is there anybody out there that could help us on the testing, and a server to test the code against?

> All the best

> James



> On 10/8/07, Bakhtiyor Khodjayev <[hidden email]> wrote:
> Hello, Graeme.

>> http://www.syrics.de/pages/page/show/Cacheable%20Plugin
>> Have you had a look at these?

> Yes, ant it's not fitted for me, so I decided create my own

> There are differences into idea and implementation of
> Cacheable Plugin and SimpleCache, so I think it's not
> good idea to merge plugins.
> You always have choice what to use.


> On, Monday, October 8, 2007, 17:22:37:

>> There is already a cache plugin in Grails plugins SVN as well as this one:

>> http://www.syrics.de/pages/page/show/Cacheable%20Plugin

>> Have you had a look at these?

>> I think we need to figure out some way to consolidate these different
>> plug-ins into one that is well documented and understood

>> Cheers

>> On 10/8/07, Bakhtiyor Khodjayev <[hidden email]> wrote:
>>> Hello, user.
>>>    First, short response in "grails caching" question:

>>> SimpleCache plugin add simple content and basic http caching
>>> (ETag support) functionality (via servlet filter and ehcache).
>>> Content is cached on URL basis and configured on (controller)
>>> action basis (2 possible methods for now - controller static
>>> field and annotation of action)

>>> Example:
>>> class SomeController {
>>>    ...
>>>    static simpleCacheConfig = [
>>>        //ttl - cache time to live in seconds
>>>        "cachedAction1" : ["ttl" : 600],
>>>        "cachedAction2" : ["ttl" : 300]
>>>    ]
>>>    ...

>>>    @SimpleCache(ttl=60)//ttl - cache time to live in seconds
>>>    def cachedAction3 = {
>>>        ....
>>>    }
>>> }
>>> ETag support transparently added to all content generated by Grails.


>>> --------------------------------------------------------


>>> And few issues:
>>> 1. Is where any convention where to put some config files within
>>> plugin infrascructure?

>>> 2. Grails sitemesh compabality problem
>>> Content served from cache not handled by sitemesh filter. It's seems
>>> that there are some "magic" hidden attributes in
>>> context/request/response

>>> 3. How to contribute plugin into grails plugins SVN?


>>> Plugin tested with RC-1-SNAPSHOT, it works, but there are still
>>> some issues, I hope it will be released on weekends.
>>> --
>>> Regards,
>>>  Bakhtiyor


>>> ---------------------------------------------------------------------
>>> To unsubscribe from this list please visit:

>>>     http://xircles.codehaus.org/manage_email


> --
> Regards,
> Bakhtiyor                          mailto: [hidden email]


> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:

>     http://xircles.codehaus.org/manage_email





--
С уважением,
Bakhtiyor                          mailto: [hidden email]


---------------------------------------------------------------------
To unsubscribe from this list please visit:

     http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re[6]: SimpleCache plugin development issues

Bakhtiyor Khodjayev
Hello, James.

> For dynamic content etags would be great. But I would not use the
> RAILS model, which is to process the request and then to calculate
> an etag based on the response, as the server has still do all the
> processing.

SimpleCache put response (and calculated ETag) to ehcache cache, so for the next request is served from cache. ETag calculated as md5 digest of response body, if it slow downs we can apply your suggested  algorithm of calculating ETag.

There is no intersection in our plugins functionality, so we can finish current tasks (for me there are still some issues with plugin), then suppose on weekends (or other time convenient for you) can start to discuss and merge. I'll contact you by email for more contact information.


On Monday, October 8, 2007, 20:10:06:

> Merging them would be great. It was always the plan to add dynamic content at later stage.

> There was a reason for not adding etags and that was because as at
> this stage we are dealing with static content and what we are trying
> to do is stop the server getting hit at all, and therefore we went
> down the road of setting the expires header. Adding an ETAG would
> mean that the browser would check to see if the content has been
> modified. "If you're not taking advantage of the flexible validation
> model that ETags provide, it's better to just remove the ETag
> altogether. The Last-Modified header validates based on the
> component's timestamp. " see
> http://developer.yahoo.net/blog/archives/2007/07/high_performanc_11.html

> For dynamic content etags would be great. But I would not use the
> RAILS model, which is to process the request and then to calculate
> an etag based on the response, as the server has still do all the
> processing. The better model would be to calculate the etag on a
> unique hash of request parameters, as then the server could very
> quickly calculate if the request is the same as previous request.
> This has a gotcha and that is if the same request does not result in the same result.

> For example I if my request is x=2 and y =3 and my response is 5,
> this method will work. But if another request is modifiable by
> another domain then the we need some mechanism to work out if this domain has been modified.

> All the best

> James

> On 10/8/07, Bakhtiyor Khodjayev <[hidden email]> wrote:
> Hello, James.

> It's seems that Cache Plugin serves well static content (or mayby
> I'm wrong?), and SimpleCache only dynamic content, so they compliment each other.

> We can merge two plugins, we can don't merge.


> Suggestion to sligtly improve Cache Plugin - adding ETag support
> (see http://www.infoq.com/articles/etags )




> On, October 8, 2007, 19:08:06:

>> bakhtiyor,

>> I think our cache plugin -- grails plugin is very simler to what
>> you are doing. It is not the same as Cacheable Plugin.

>> Take a look at http://docs.codehaus.org/display/GRAILS/Cache+Plugin

>> And code is in the grails plugin svn.

>> It is very near to been ready. All that needs doing is some tests
>> from an outside server to check performance.  So far we have good
>> results from a local server, but we have not tested each caching tecnique from a remote server.

>> The plugin works by creating virtual directories where your
>> css/js/images are stored, and sets the expired header on them to the
>> future, so that the browser/squid cache, caches them. When you
>> change the underling file a new virtual folder is created so the
>> browser/cache believes that it has new file, and downloads the new copy.

>> The other features of the plugin (some more ready than others) is
>> that it combines all your css and js into two files, and then
>> optimises the files to reduce the file size. For JS files it uses
>> JSmin and we are still working on the css reducer.

>> The concept behind it is to get the browser, and or a squid proxy to do most of all work.

>> It follows the cache guidelines proposed by both yahoo with there
>> yslow tool, and the google teams recommendation for increasing performance.

>> What needs testing is that each technique has a penalty on the
>> first download, and a reward for subsequent downloads of a page, and we need to analyse that.

>> Is there anybody out there that could help us on the testing, and a server to test the code against?

>> All the best

>> James



>> On 10/8/07, Bakhtiyor Khodjayev <[hidden email]> wrote:
>> Hello, Graeme.

>>> http://www.syrics.de/pages/page/show/Cacheable%20Plugin
>>> Have you had a look at these?

>> Yes, ant it's not fitted for me, so I decided create my own

>> There are differences into idea and implementation of
>> Cacheable Plugin and SimpleCache, so I think it's not
>> good idea to merge plugins.
>> You always have choice what to use.


>> On, Monday, October 8, 2007, 17:22:37:






> --
> С уважением,
> Bakhtiyor                          mailto: [hidden email]


> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:

>      http://xircles.codehaus.org/manage_email





--
Regards,
 Bakhtiyor                      


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email