tonio
unread,Feb 7, 2011, 5:12:05 PM2/7/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rack-cache
Hello everyone,
I loved rack-cache from the very first time that I used it, but now I
have a more complex requirement...
My app has a cookie with two important values: lang and country_code.
This values are similar to many people, but I need to cache
separately, because if I don't do it all the visitors see the site in
the same language and localization with the cache enable...
I was looking for the cache_key option and I was thinking to add
something like this:
set :cache_key do |request|
request.fullpath.replace(/\//, '-') + "-
lang:#{request.cookies['lang']}" +
"cc:#{request.cookies['country_code']}"
end
But I don't have a clue where I have to put that =(
Can anybody please help me telling me where...
Cheers,
José Antonio