About WinCache ( Windows Cache Extension )
Posted on November 29th, 2016
Windows Cache Extension is used to store PHP bytecode. It is the compiled version of a PHP script. In memory making it can be useful when subsequent executions of the same script are needed. This allows us to increase the overall performance of PHP applications. Windows Cache Extension allows the PHP bytecode to be generated only once and to be reused each time the same PHP script is executed. Thereby reducing the load on the server. When PHP scripts are stored on remote UNC file shares it reduces the latency of file operations. Windows Cache Extension includes a file system cache that is used to store the content of the PHP script files in shared memory, which helps to reduce the amount of file system operations performed by the PHP engine. Windows Cache Extension can be used to reduce file system I/O overhead by caching the PHP scripts in memory.
Windows Cache Extension provides user cache API’s to store PHP objects and variables in shared memory in PHP scripts. This way PHP scripts improves the execution speed by storing processed data in the cache and then using it in subsequent requests instead of recreating the data on every request. Windows Cache Extension uses relative file path cache to avoid redundant mapping.
Types of caches in Windows Cache Extension
1) PHP Opcode Cache
PHP Opcode Cache is the standard opcode cache. It caches the compiled bytecode of the most used scripts which helps to avoid the system to perform identical tasks multiple times. IT stores these compiled scripts bytecode in shared memory so that it can be re-used to perform identical tasks. PHP is a script processing language which reads the text or PHP instructions and produces another stream of data in an HTML format. This means that each time the PHP reads, parses, compiles, and executes a PHP script requested by the web client. These operations put a high load on the web server’s CPU and file system. Thus it affect the performance of the web application, so the PHP opcode cache can be used to decrease this load on the server.
2) File Cache
With PHP opcode cache, the PHP engine has access the script files on a file system so the Windows cache extension includes a file cache which caches the PHP files by loading them in a shared memory block. The file operations produce a performance overhead on the server if the PHP scripts are stored on a remote UNC file share so the file cache can be used to avoid the expensive I/O operations on the server.
3) Resolve File Path Cache
Resolve File Path Cache is used to store the mappings between relative and absolute file paths in file operations. PHP scripts perform file operations using relative file paths. PHP engines minimizes every file path to an absolute file path, so the operation of resolving the paths may affect the application performance. The windows cache extension provides a resolve file path cache which is used to reduce the number of path resolution if a PHP application uses many PHP files and access them by resolve paths.
4) User Cache
User Cache is used to store PHP objects and variables that can be built for each user that can be reused for subsequent requests instead of recreating the data on every request. This can be used to share the data across multiple PHP processes which improves script performance.
5) Session Handler
Session Handler is used to store the PHP session data in the shared memory cache. The Session Handler is used to improve the PHP performance when large amounts of data stored in PHP session by reducing the file system operations for reading and writing session data.
1) Support PHP 5.2, PHP 5.3 , PHP 5.4, PHP 5.5 and PHP 5.6.
2) Configurable file cache
3) Configurable PHP opcode cache
4) Relative file path cache
5) PHP functions to obtain information about the cache status
6) User Cache API’s
7) File change notification support
8) WinCache handler for PHP sessions
If you need any further assistance please contact our support department.