gzip encoding and cakephp

50 views
Skip to first unread message

phpcurious

unread,
Oct 14, 2009, 3:35:28 AM10/14/09
to CakePHP User Group Philippines
Hi,

I want to try gzip encoding to make output from cakephp faster.
anyone already tried this? Did it really help?
or should I try memcache instead?

phpcurious

Jed

unread,
Oct 14, 2009, 4:11:14 AM10/14/09
to cakep...@googlegroups.com
Hi phpcurious,

cakephp 1.2 already has a built in file engine
go to app/config/core.php

Cache::config('default', array('engine' => 'File'));

It's really fast no need to use third party.

Jed

Oliver John Tibi

unread,
Oct 14, 2009, 4:17:37 AM10/14/09
to cakep...@googlegroups.com
Jojo,

Memcache is used for the view cache itself, and it reduces the time to
process the PHP stack. It stores the processed view of any action that
you have marked for caching.

Some tips:
* If a cached version of a view has been found by CakePHP, the
dispatcher WILL NOT go to the controller for processing. It will go
directly to the cached view and make use of the pre-processed variable
values that came with the cache view when it was generated.
* This does not apply to variables from sessions (useful if you need
to output login related information for the user, like username or
email address).

GZip compression, on the other hand, is used post-process, but before
transporting the resources to the user's browser. It's very useful to
apply it to other static properties of the site (like
css,js,gif,png,jpg,etc...). You can apply GZip compression
(mod_deflate) server-wide (httpd.conf) or by directory, if allowed
(using .htaccess in your webroot/img or webroot/css directories).

I use a combination of Memcache, APC, and GZip to serve up my pages.

Check the docs on Apache's mod_deflate so you can get some samples.

Cheers,
OJ

phpcurious

unread,
Oct 14, 2009, 11:00:09 AM10/14/09
to CakePHP User Group Philippines
thanks to all for the tips!

On Oct 14, 4:17 pm, Oliver John Tibi <ojt...@gmail.com> wrote:
> Jojo,
>
> Memcache is used for the view cache itself, and it reduces the time to
> process the PHP stack. It stores the processed view of any action that
> you have marked for caching.
>
> Some tips:
> * If a cached version of a view has been found by CakePHP, the
> dispatcher WILL NOT go to the controller for processing. It will go
> directly to the cached view and make use of the pre-processed variable
> values that came with the cache view when it was generated.
> * This does not apply to variables from sessions (useful if you need
> to output login related information for the user, like username or
> email address).
>
> GZip compression, on the other hand, is used post-process, but before
> transporting the resources to the user's browser. It's very useful to
> apply it to other static properties of the site (like
> css,js,gif,png,jpg,etc...). You can apply GZip compression
> (mod_deflate) server-wide (httpd.conf) or by directory, if allowed
> (using .htaccess in your webroot/img or   webroot/css directories).
>
> I use a combination of Memcache, APC, and GZip to serve up my pages.
>
> Check the docs on Apache's mod_deflate so you can get some samples.
>
> Cheers,
> OJ
>
Reply all
Reply to author
Forward
0 new messages