Output Caching with PHP (
Page 1 of 5 ) Dynamic Web pages take longer to load than static ones, which forces visitors to your site to wait -- and we all know they won't wait for very long. Output caching is a powerful technique you can use to shorten that wait and keep them from leaving.If we take a nostalgic look at those distant days when developing Websites consisted of writing a few, static HTML pages, made up mostly of text and scarce images, we notice that the process of sending a Web page from the Web server to a Web browser was painless and straightforward. The server had to fetch some files from the file system, and send them happily to the user’s browser, which received the parsed page almost immediately.
Once the page was displayed, the browser would trigger its caching routines to store the finished page on the user's computer, until a new request was made for that page. With a new request for that page, the browser performed a fast check with the Web server to make sure the page hadn’t been updated, and then could display the cached, locally stored version. Ah, memories!
As you know, the Web became more and more complex, and new techniques had to be developed for delivering dynamic content. Most websites migrated from static to dynamic schemas, according to current demands for satisfying content-hungry visitors. This new context rapidly broke the well-established process described above.
Now, nearly every page requested puts into action some kind of intermediate process (or many of them) that introduces a noticeable delay when delivering Web pages to the end user. If you are within the field of PHP processing, you know that the Web server will call the PHP engine for parsing scripts, and maybe those scripts will connect to databases, and so on, all of this resulting in a lag between the user’s request for a page and the final display in the browser.
If keeping our applications simple is not mandatory, they will become more complex, and easily cause us to run into difficulties that could increase the lag problem. There are many possible approaches to solve this situation. In this article, we will see how server side caching can help us to implement simple but powerful PHP mechanisms to avoid, or reduce, the delay between a Web server sending a dynamic page and the user seeing the finished result displayed on the machine.
| | Discuss Output Caching with PHP | | | | | | | The article deals with the basics of PHP Output Caching. Also, it shows some chunked... | | | | | |
For the sake of clarity and accuracy, where it reads $cachefile, should be... | | | | | | Too much editorialising, discussing history, something. After reading the first... | | | | | | Hello Sr.
Thank you for the comment. I'm sorry you didn't enjoy the article. That... | | | | | | I find it interesting that you didn't mention Smarty as a caching option. On top of... | | | | | | Hi David,
Thank you for the commnent. The interspered PHP is only for the... | | | | | | i am a beginner, just pure questions.
what's the point of using all the ob_start,... | | | | | | Yes , i like it and am using it long time ago , the benefit( my opinion) the cache... | | | | | | Hi,
I totally agree with you!
Alejandro Gervasio | | | | | | Hello,
This article is intented to be an introduction to PHP cache capabilities,... | | | | | | I disagree, the beginning of the article made the subject and benefit quite... | | | | | | David says he'd like to see the HTML and PHP in separate files. I've been reading a... | | | | | | Well, Smarty is an excellent template system (and includes more capabilities too)... | | | | | | im kinda new to caching and I was trying the original script..im sorry if it looks... | | | | | | ok im replying to myself, erm it's late here and i hate these kinda glitches that... | | | | | | Is it possible to implement this process in the phpBB code for discussion... | | | | | | Thank you for posting your comment here. With regard to your question, unfortunately... | | | | | | Thanks for the very prompt reply! I guess I should just give up then....have spent... | | | | | | I'd like thank you for posting your feedback here. With reference to your problem,... | | | | | | Good Tutorial thk,
just a little correct though
It would probly not be long for U... | | | | | | Hi Sig again,
Thank you fo pointing out the missing parenthesis on the code. It... | | | | | | thnX a lot Alejandro for this amazing article.
when I was read it ,I could see the... | | | | | | Thank you for the kind comments on my PHP article and your excellent suggestion on... | | | | | | There's a straight forward explanation why there must be files. Caching is supposed... | | | | | | Thanks for the great contribution. That’s exactly the purpose in caching PHP... | | | | | | Hey, this is a great article, really made caching seem a simple affair! I am... | | | | | | Thanks for the kind words on my PHP caching article. Regarding your questions,... | | | | | | Thanks for your article. This gave me a good view of how Caching works, had no idea... | | | | | | >>> Post your comment now! | | | | | |
|
 |
|