gzip - nginx + gzip_static_module -
scenario: have 2 files "style.css" , "style.css.gz". enabled modules gzip_static , gzip. works properly, nginx serve compressed "style.css.gz". both files have same timestamp. have cronjob creates pre-compressed files of file * .css , runs every 2 hours.
gzip on; gunzip on; gzip_vary on; gzip_static always; gzip_disable "msie6"; gzip_proxied any; gzip_comp_level 4; gzip_buffers 32 8k; gzip_http_version 1.1; gzip_min_length 256; gzip_types text/cache-manifest text/xml text/css text/plain ...........
question: if edit "style.css" , change few css rules, possible serve edited "style.css" instead of "style.css.gz"? (based on timestamp or smthing that) or pre-compress new "style.css.gz" after finish editing "style.css"? possible operate using nginx? or best solution?
thanks
i have cronjob creates pre-compressed files of file * .css , runs every 2 hours.
you can run script manually after have made edit/changes css file.
it possible operate using nginx? or best solution?
alternatively, solution can think of (which how roll) nginx can serve , gzip compress files on fly. make sure disable use of precompressed files ngx_http_gzip_static_module otherwise nginx use precompressed files instead.
gzip_static off;
enables (“on”) or disables (“off”) checking existence of precompressed files.
Comments
Post a Comment