views:

172

answers:

1

I am using caches_action to cache one of the action's response

I want to save in the cache compression response and then send it as it is if browser supports that compression otherwise decompress it and then send it.

Some characteristics of my content: 1. It rarely changes 2. My server gets requests from 90% gzip enabled browsers

Do you see any issue with this approach?

If you it is a right approach then is there a easy way to achieve the same?

A: 

Compression should be handled by Apache or the webserver. Assuming the client supports compression, the webserver will load your static file and serve a compressed response.

I suggest you to have a look at your webserver configuration. Here's an example using Apache.

Simone Carletti
Why store a big blog in cache and then compress it every time a user requests it?I would like to store in cache in the form most browsers needs it.
Arvind
Have a look into apache's mod_disk_cache which can exactly do that. Combined with proper http headers from your application this is a major speed boost.
hurikhan77