[yast-devel] caching large values
Hi, as I mentioned yesterday, I have a problem with caching of data. The data to cache are the commands accepted by individual LSB init scripts. They used to be cached in the session map which is now stored in cookies. Originally the list of scripts was a small faked one but as soon as I switched to the real thing, the cookie started to overflow: ActionController::Session::CookieStore::CookieOverflow As a temporary workaround I turned off the cache. What options are there for caching? -- Martin Vidner, YaST developer http://en.opensuse.org/User:Mvidner Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
Martin Vidner napsal(a):
Hi,
as I mentioned yesterday, I have a problem with caching of data.
The data to cache are the commands accepted by individual LSB init scripts. They used to be cached in the session map which is now stored in cookies. Originally the list of scripts was a small faked one but as soon as I switched to the real thing, the cookie started to overflow: ActionController::Session::CookieStore::CookieOverflow As a temporary workaround I turned off the cache.
What options are there for caching?
Do you consider using Ajax for it and store it in controller?? Just have id on page and rest of page generate dependend on first user choice. Same as I store whole big timezone map in controller and on page has only region and timezones for this region. And if user change region then I send new local timezones. If you need hint look at module time or we can discuss it on Thursday. JR -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
* Martin Vidner <mvidner@suse.cz> [Jun 23. 2009 17:09]:
Hi,
as I mentioned yesterday, I have a problem with caching of data.
The data to cache are the commands accepted by individual LSB init scripts. They used to be cached in the session map which is now stored in cookies.
Can you explain in more detail why this is needed and what you're trying to achieve ?
Originally the list of scripts was a small faked one but as soon as I switched to the real thing, the cookie started to overflow: ActionController::Session::CookieStore::CookieOverflow As a temporary workaround I turned off the cache.
What options are there for caching?
The rest-servicce backend should not cache anything since it is meant to be stateless. The web-client should only hold the session cookie for caching the login credentials. Klaus --- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
Klaus Kaempf napsal(a):
* Martin Vidner <mvidner@suse.cz> [Jun 23. 2009 17:09]:
Hi,
as I mentioned yesterday, I have a problem with caching of data.
The data to cache are the commands accepted by individual LSB init scripts. They used to be cached in the session map which is now stored in cookies.
Can you explain in more detail why this is needed and what you're trying to achieve ?
Originally the list of scripts was a small faked one but as soon as I switched to the real thing, the cookie started to overflow: ActionController::Session::CookieStore::CookieOverflow As a temporary workaround I turned off the cache.
What options are there for caching?
The rest-servicce backend should not cache anything since it is meant to be stateless. The web-client should only hold the session cookie for caching the login credentials.
I think that caching in web-client is not so bad, if you cache "constants". Of course you can define constants directly in this module, but it is possible that that constant is changed sometime (less then once per month). For example possible timezones is quite big data, which doesn't change much often. So I cache it in web-client to save some transfer and to increase performance (waiting more then second to after every action on web page is to much for me). JR
Klaus --- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
-- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
* josef reidinger <jreidinger@suse.cz> [Jun 24. 2009 11:21]:
Klaus Kaempf napsal(a):
The rest-servicce backend should not cache anything since it is meant to be stateless. The web-client should only hold the session cookie for caching the login credentials.
I think that caching in web-client is not so bad, if you cache "constants".
Agreed. And making resource cacheable is one of the core features of REST. But its actually up to the rest-service to indicate the lifetime of the resources via the http header. The web-client should honor this information.
Of course you can define constants directly in this module, but it is possible that that constant is changed sometime (less then once per month). For example possible timezones is quite big data, which doesn't change much often. So I cache it in web-client to save some transfer and to increase performance (waiting more then second to after every action on web page is to much for me).
Now such caching should be done in the resource proxy within the web-client. It doesn't belong to the session cache because it can be shared across sessions. Don't get me wrong here. I'm all for caching. But we need to be careful on what, when, and how resources get cached. Klaus --- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
Klaus Kaempf wrote:
* josef reidinger <jreidinger@suse.cz> [Jun 24. 2009 11:21]:
Klaus Kaempf napsal(a):
The rest-servicce backend should not cache anything since it is meant to be stateless. The web-client should only hold the session cookie for caching the login credentials. I think that caching in web-client is not so bad, if you cache "constants".
Agreed. And making resource cacheable is one of the core features of REST.
But its actually up to the rest-service to indicate the lifetime of the resources via the http header. The web-client should honor this information.
Of course you can define constants directly in this module, but it is possible that that constant is changed sometime (less then once per month). For example possible timezones is quite big data, which doesn't change much often. So I cache it in web-client to save some transfer and to increase performance (waiting more then second to after every action on web page is to much for me).
Now such caching should be done in the resource proxy within the web-client. It doesn't belong to the session cache because it can be shared across sessions.
Don't get me wrong here. I'm all for caching. But we need to be careful on what, when, and how resources get cached.
Klaus
Could you please post some example (and ideally also document it somewhere) how to use this resource proxy caching? thanks JR -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
* Josef Reidinger <jreidinger@suse.cz> [Jun 25. 2009 15:44]:
Could you please post some example (and ideally also document it somewhere) how to use this resource proxy caching?
This should be completely transparent to the application using YaST::ServiceResource.proxy_for(). The object returned by proxy_for must handle the caching and check for read vs. write access to its properties. Klaus --- SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: yast-devel+unsubscribe@opensuse.org For additional commands, e-mail: yast-devel+help@opensuse.org
participants (4)
-
Josef Reidinger
-
josef reidinger
-
Klaus Kaempf
-
Martin Vidner