hmm, good question.
For me, in general in stance for creating a static page out of your dynamic pages based on specific timestamp.
Now bare with me as english isn't my native language, hope you can understand the following explanation:
Grab your dynamic content using output buffering (ob_start() etc) give it a timestamp and generate a static html page. When a user comes to your website check if your static-timestamp-html is still valid. If valid show your static page else do your dynamic-queries-page.
Remember it all depends on your website content. Here are some examples I can think of:
1/ a busy website with 20.000 unique daily visitors and pages with more then 20 sql queries, which content is updated on daily basis would benefit from caching files.
2/ a website which uses more then one external rss- feeds. Caching your pages which uses rss-feeds will speed up your website.
Another tip: use a cronjob for this. So around midnight it pulls the rss-feeds and creates a static page for that day. No more waiting time from the external website.
From phpfreaks / phpit
Quote:
| When you run a popular website that uses PHP and MySQL you will most likely notice that your website becomes slow when your website is at its busiest. If you've really optimized your PHP script and MySQL server, you'll probably be able squeeze some additional performance out of your website, but there comes a time when it's just too much to handle. That's where caching comes in. |
Anywayz, tell us your thoughts and ideas.