Jump to content

PHP Caching


quiettech

Recommended Posts

Hello all,

I've been doing PHP for around a month now. Even managed to produce a pro-bono website for a friend as part of my apprenticeship covering mysql access, minor security features (input validation mostly), SOAP, sessions and cookies. If you are interested in taking a peek, it's at http://www.mzproperty.co.uk. But that's beside the point.

 

I'm quite happy with the language and its features, but there is one thing nagging me that I can't find an answer for on my yet small book collection (if you can call 2 books a collection). I'm definitely wanting to get into OOP and make that my main conduct in developing php applications. It just feels natural to take this step; and even more so for someone like me who is coming from a background in programming languages where OOP takes centrestage. This is my question...

 

In creating a class, I'm doing this on a script file that will be included in every php file that creates instances of that class. However it worries me that I may be forcing the server to reevaluate the class definition in every page that is requested and where objects of that class get instantiated. Basically every page is its own entity that forces all includes to be parsed from scratch. This is how I look at PHP. For bigger, more complex classes and hierarchies however this may become just too inefficient.

 

How does PHP really work with Apache? In the absence of a caching mechanisms like eAccelerator, ZendOptimizer, PhpExpress and others, is there a certain level of caching occurring at least at session level that I can trust to not worry too much? Or do class definitions in fact get parsed over and over again with every request?

 

TIA.

Link to comment
https://forums.phpfreaks.com/topic/101299-php-caching/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.