Nico Knoll Posted December 19, 2011 Share Posted December 19, 2011 Hi, is there a way to use the following code at the top of my template or somewhere else? ob_start("ob_gzhandler"); Greets, Nico Link to comment Share on other sites More sharing options...
formmailer Posted December 19, 2011 Share Posted December 19, 2011 Personally I would prefer enabling compression in Apache, using mod_deflate for example.. /Jasper Link to comment Share on other sites More sharing options...
Nico Knoll Posted December 19, 2011 Author Share Posted December 19, 2011 So, what is the best/preferred compression method of Processwire pages and how can I use it? Link to comment Share on other sites More sharing options...
Soma Posted December 19, 2011 Share Posted December 19, 2011 Maybe you want to check out this http://html5boilerplate.com/docs/htaccess/ Link to comment Share on other sites More sharing options...
Nico Knoll Posted December 19, 2011 Author Share Posted December 19, 2011 Hmm... I'm not good with htaccess... So is there a way to use the PHP way? :/ Link to comment Share on other sites More sharing options...
Nico Knoll Posted December 21, 2011 Author Share Posted December 21, 2011 Maybe Ryan knows it? Link to comment Share on other sites More sharing options...
Soma Posted December 21, 2011 Share Posted December 21, 2011 I would use .htaccess, much easier. Link to comment Share on other sites More sharing options...
ryan Posted December 21, 2011 Share Posted December 21, 2011 This is something I don't know much about yet and need to do more research. You've got me curious. Looking at Drupal7, it looks like they do it with PHP, though only if one specifically enables some page_compression and cache options. I only see reference to it in their /includes/bootstrap.inc for serving pages from the cache. It looks like it involves checking a lot of $_SERVER variables to verify gzip support, delivering a "content-encoding: gzip" header and spitting out the gzipped data when appropriate. They create the gzipped data with PHP's gzencode function. It appears that they only use it for delivering data from the cache. That makes me think that the gzencode is potentially slow and they are caching and performing the gzencode after delivering a page where it can be picked up from the cache by the next request. What's interesting is that they gzip the cache data even if not supported by the client and they gzinflate it at runtime for clients that don't support it. I suppose this makes sense, and a good way to keep smaller cache sizes. This is something we'll probably want to implement in PW's core PageRender module at some point. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now