paolochiodi / htmlcompressor

A work in progress port of google's htmlcompressor.jar
Other
150 stars 26 forks source link

Cached Pages don't get compressed #11

Closed Rembrant closed 9 years ago

Rembrant commented 10 years ago

I am using actionpack-page_caching to cache static pages and the htmlcompressor as middleware. When I look at my Rails server's response source code in Chrome DevTools it is compressed but when I look at the source of my Page Cached file it is not compressed.

How would this best be fixed? Thanks.

paolochiodi commented 10 years ago

This is a good idea. It should also be easy to integrate since all the work is done by the Compressor class. Give me a couple of days to study actionpack-page_caching, and I'll be back with a solution.

At the moment I think the best way to address this is by separating the compressor class in his own gem, keep this one for the rack middleware and have a new one to be compatible with rails and actionpack-page_caching

le0pard commented 10 years ago

Hello @paolochiodi . My solution for this: https://github.com/rails/actionpack-page_caching/issues/10#issuecomment-30801578

paolochiodi commented 9 years ago

I'm going to close this old issue, at the moment I'm not looking to include into the gem a specific rails hook.

Thank you @le0pard for sharing your solution