# Caching, purging & gzip

**URL:** <https://www.ruby-forum.com/t/caching-purging-gzip/204555>\
**Category:** NGINX\
**Created:** [March 15, 2011, 3:22pm UTC](https://www.ruby-forum.com/t/caching-purging-gzip/204555 "2011-03-15T15:22:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [March 15, 2011, 3:22pm UTC](https://www.ruby-forum.com/t/caching-purging-gzip/204555/1 "2011-03-15T15:22:57Z")

</div>

Hello everybody,

I currently have Nginx running as a reverse static proxy cache. I cache  
CSS/JPG/JS file with proxy\_cache directive. I’ve also cache purging with  
ngx\_cache\_purge module ( [FRiCKLE Labs / nginx / ngx\_cache\_purge](http://labs.frickle.com/nginx_ngx_cache_purge/)  
)

Now I would like to serve my CSS/JPG/JS gzipped. What do you think is  
the best way to achive this ?

1. Modify apache conf to serve gzipped file to Nginx
2. Configure NGINX to serve gzipped version with HttpGzipStaticModule

Please consider that :

1. I still want my CSS/JPG/JS to be cached by nginx
2. I still want be able to purge CSS/JPG/JS from the cache by using  
ngx\_cache\_purge module
3. I don’t want to overload the reverse proxy machine with gzip  
operations so I was thinking about  
[http://wiki.nginx.org/HttpGzipStaticModule#gzip\_static](http://wiki.nginx.org/HttpGzipStaticModule#gzip_static) directives

Waiting for your hints

Ciao

–  
Simone
