Improving Performance - Code caching (Acceleration)
(Page 4 of 6 )
Code Acceleration is sometimes referred to as code caching. In fact it is very different from content caching because it caches the code and not the content. Code acceleration is at work when the server runs the script inside the PHP script engine.
By default, every time a PHP script is accessed, the script is parsed and compiled before it is executed. As long as the script does not change, parsing and compiling is redundant. Code caching maintains the compiled byte code version of the PHP script in memory, eliminating the need to parse and compile each time.
Code caching actively maintains the cached compiled scripts in a shared memory model, serving each process that is generated by the web server. For this reason, it is critical that the code accelerator be tightly integrated with the scripting engine, to ensure proper memory utilization and prevent failure.
Figure 3 - Code Acceleration

Query caching
In dynamic web sites, the database server is more likely to become the bottleneck since every query has to be processed and the quality of service drops dramatically under heavy load.
In query caching, the cache contains a list of recently executed queries and their results. Whenever possible, a new query is satisfied by results already stored in the cache, thereby avoiding potentially large data scans.
This technique benefits web applications that run complex, process intensive queries. For web applications that run frequent small-scale queries, the latency caused by the travel time over the network will most likely overshadow the benefit from query caching.
Figure 4 - Query caching

Next: Client-side caching >>
More Zend Articles
More By Zend