Question : Cache Dynamic Page Content in Apache / PHP

Hi,

I am working on a php/mysql/apache site that gets a decent amount of traffic. I have been trying to reduce the server load / load times of pages. I have optimized a lot of the queries and indexed needed parts of tables. The content on the site is displayed specifically for the type of user that is logged in and what geographic location they are in. So for example a user from Maine sees different content than a User from Georgia but are both accessing the same php file.

Apache 2.0
PHP 5.2.10-2.2
Zend Framework
MySQL 5.1.4


Since it handles what is displayed via session variables I am guessing that Apache/PHP isn't able to cache the page because the content is different depending on who views the page...

Is there a standard/good way to implement caching for a system like this?

I would like to reduce the number of database queries being sent to the server and since the data doesn't change all that often I thought caching would be a good way to do it, but since it displays things like the logged in users name, and displays different content to different users etc, I don't see how it can work. If I serve a cached page then the username could be wrong or display the wrong states content.

Is there an alternative to caching for sites like this?

Thanks for thoughts/input/etc...

I understand that the answer may just be "no there isn't a way to do this".

Answer : Cache Dynamic Page Content in Apache / PHP

This page, and the others listed in the left sidebar may have some good ideas for you...
http://us2.php.net/manual/en/book.apc.php

Some of my colleagues have spoken well of memcacheD:
http://us2.php.net/manual/en/book.memcached.php

Finally, not to badmouth frameworks, but you might want to look at your page load time for the Hello World script.  I have found that some frameworks dynamically load numerous little pieces - separate classes in separate files, and so on - that the page load time for even the simplest pages is greatly influenced by the disk service time required to gather up all those little files.  If there is a way to combine the files so that the framework loads fewer files as it services each HTTP request, that is almost certain to help performance across the site.

Hope that helps, ~Ray
Random Solutions  
 
programming4us programming4us