Response Headers (Caching)

2 views
Skip to first unread message

Robert

unread,
Jul 30, 2008, 10:15:24 PM7/30/08
to zoop-users
Rick,

Even though I am still in development, I wanted to check out browser
caching for my graphics. I installed headers and expires modules on
my apache2 server and set up the definitions in my httpd.conf to allow
caching. http://www.websiteoptimization.com/speed/tweak/cache/

The pages that are served from my server now allow caching for my
graphics except those pages that are part of my zoop development
project. Response headers for my zoop developed pages still say:

Date: Thu, 31 Jul 2008 01:46:16 GMT
Server: Apache/2.2.4 (Ubuntu) DAV/2 SVN/1.4.4 PHP/5.2.3-1ubuntu6.3
mod_ssl/2.2.4 OpenSSL/0.9.8e
X-Powered-By: PHP/5.2.3-1ubuntu6.3
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-
check=0
Pragma: no-cache
Content-Length: 2678
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/html

200 OK

My questions:
Is Zoop setting these response headers? Or Smarty?
Are there some parameters in Zoop that I need to set to allow caching
and/or to set response headers?
Earlier versions of Zoop had an 'app_status' global that distinguished
between dev and prod (I assume). It must have set different parameters
such as debuging code and maybe caching parameters. How is that done
now? Does Zoop allow distinction between development and production?
If so how is that configured?

Rick Gigger

unread,
Jul 31, 2008, 3:36:07 AM7/31/08
to zoop-...@googlegroups.com
On Jul 30, 2008, at 8:15 PM, Robert wrote:
> Even though I am still in development, I wanted to check out browser
> caching for my graphics. I installed headers and expires modules on
> my apache2 server and set up the definitions in my httpd.conf to allow
> caching. http://www.websiteoptimization.com/speed/tweak/cache/
>
> The pages that are served from my server now allow caching for my
> graphics except those pages that are part of my zoop development
> project. Response headers for my zoop developed pages still say:
>
> Date: Thu, 31 Jul 2008 01:46:16 GMT
> Server: Apache/2.2.4 (Ubuntu) DAV/2 SVN/1.4.4 PHP/5.2.3-1ubuntu6.3
> mod_ssl/2.2.4 OpenSSL/0.9.8e
> X-Powered-By: PHP/5.2.3-1ubuntu6.3
> Expires: Thu, 19 Nov 1981 08:52:00 GMT
> Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-
> check=0
> Pragma: no-cache
> Content-Length: 2678
> Keep-Alive: timeout=15, max=100
> Connection: Keep-Alive
> Content-Type: text/html
>
> 200 OK
>
> My questions:
> Is Zoop setting these response headers? Or Smarty?

PHP is setting them itself. Because the content is dynamically
generated PHP sends out headers to tell the browser to re-request it
every time. I think it modifies them further when you use the PHP
Session handling functions which you are using if you are using zoop
sessions.

> Are there some parameters in Zoop that I need to set to allow caching
> and/or to set response headers?

All you need is the PHP header function (http://us2.php.net/header).
That page even has some cache control examples on it. If you learn
how all of the cache related headers work then you can get it to do
whatever you want. I have done this for images (or other static
files) that I create and want cached. I can show you the headers that
I have been using and what they do.

> Earlier versions of Zoop had an 'app_status' global that distinguished
> between dev and prod (I assume). It must have set different parameters
> such as debuging code and maybe caching parameters. How is that done
> now? Does Zoop allow distinction between development and production?
> If so how is that configured?

The configuration system for zoop is very, very flexible and there are
different ways to have different configs for dev, testing, and
production. I can run you through the different ways of doing it if
you like. Because I often had situations where I didn't care
specifically about whether I was in dev, test, or prod, in Zoop I have
leaned more towards giving a bunch of config options and allowing you
to have totally separate files for each state that you can switch back
and forth between.

I will try to come with some wiki pages or code examples on how to
handle using different config files. Are there specific things you
are looking for?

Rick

Reply all
Reply to author
Forward
0 new messages