Topic: Playing with caching

Instead of posting the whole bit once more, I'll just link to the post I made at The Forum Insider: http://www.foruminsider.com/forums/inde … wtopic=183

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Playing with caching

Nice stats smile

3 (edited by Paul 2004-02-01 17:52)

Re: Playing with caching

I'm trying to learn something here so I am trying to work out how this works. Is this correct.

Instead of having to fetch config information from the database all the time, the database is queried and the results are stored in a php file. MMCache is then used to compile the php file. This results in a speed increase because retrieving the information from a compiled php file is faster than running a database query(s).

Are there any security implications because you are allowing writing to php files? Not that it makes much difference because I bet a lot of people are running PunBB with CHMOD 777 anyway.

Re: Playing with caching

Paul wrote:

Instead of having to fetch config information from the database all the time, the database is queried and the results are stored in a php file. MMCache is then used to compile the php file. This results in a speed increase because retrieving the information from a compiled php file is faster than running a database query(s).

Almost correct. MMC doesn't compile the code, the Zend engine does. MMC just keeps the compiled code in memory (or on disk if it is out of memory) for PHP, so that the next time the script is to be executed, the Zend engine can fetch the already-compiled code directly from MMC's shared memory area.

Paul wrote:

Are there any security implications because you are allowing writing to php files? Not that it makes much difference because I bet a lot of people are running PunBB with CHMOD 777 anyway.

Nono that I can think of. If people are chmodding their config.php to 777, the security is b0rked anyway :D

"Programming is like sex: one mistake and you have to support it for the rest of your life."