Only minify html, css and js, its possible?

727 views
Skip to first unread message

snoke

unread,
Mar 14, 2011, 8:00:12 AM3/14/11
to mod-pagespeed-discuss
Hey,

I like mod_pagespeed, but i have a question, i want only minify html,
css and js, i dont like a cache.

How i can disable all cache of mod_pagespeed?

Thanks

Joshua Marantz

unread,
Mar 14, 2011, 8:37:10 AM3/14/11
to mod-pagesp...@googlegroups.com, snoke
It's possible to use mod_pagespeed to minify HTML without using a cache.  Use

   ModPagespeedRewriteLevel passthrough
   ModPagespeedEnableFilters=remove_comments,collapse_whitespace,elide_attributes
   ModPagespeedLowercaseHtmlNames on

This will not touch the CSS, JS, or Images, but will aggressively minify HTML.

mod_pagespeed requires its cache to make any optimizations to CSS or JS files including minification.  In theory we could rewrite CSS and JS files on-the-fly without a cache but that would add latency & compute overhead to the server under high QPS -- that's why we designed our system to use a cache.  Although now that I think about it, we do minify *inlined* css and javascript without a cache.  To enable that functionality without caching you can add

   ModPagespeedEnableFilters rewrite_css,rewrite_javascript
   ModPagespeedDisallow *.css
   ModPagespeedDisallow *.js

This will, of course, not minify external css and js files.

Can you explain why you don't want a cache?

-Josh
Reply all
Reply to author
Forward
0 new messages