iis-logo

Microsoft IIS team released today the first beta of the Windows Cache extension for PHP (WinCache 1.0) for PHP 5.2 and 5.3. The new cache extension is a PHP accelerator that aims to increase PHP applications speed running on windows platform. The extension doesn’t require any code change, it just need to be enabled in IIS. WinCache have many directives that could be enabled/disabled in php.ini and six utility functions to return extension-specific information about the cache internals.
Joe Stagner, posted an introduction to the windows cache extension and pointed to some notes about compatibilities :

  • The extension can only be used with non-thread-safe builds of PHP
  • The extension can only be used when IIS is configured to run PHP via FastCGI
  • The Windows Cache Extension 1.0 for PHP 5.3 can only be used with the x86 VC9 build of PHP 5.3.

The Windows Cache Extension includes 3 different types of caches. The following describes the purpose of each cache type and the benefits it provides.


PHP Opcode Cache
PHP is a script processing engine, which reads an input stream of data that contains text and/or PHP instructions and produces another stream of data, most commonly in the HTML format. This means that on a web server the PHP engine reads, parses, compiles and executes a PHP script each time that it is requested by a Web client. The reading, parsing and compilation operations put additional load on the web server’s CPU and file system and thus affect the overall performance of a PHP web application. The PHP bytecode (opcode) cache is used to store the compiled script bytecode in shared memory so that it can be re-used by PHP engine for subsequent executions of the same script.
File Cache
Even with the PHP bytecode cache enabled, the PHP engine has to accesses the script files on a file system. When PHP scripts are stored on a remote UNC file share, the file operations introduce a significant performance overhead. The Windows Cache Extension for PHP includes a file cache that is used to store the content of the PHP script files in shared memory, which reduces the amount of file system operations performed by PHP engine.
Relative File Path Cache
PHP scripts very often include or operate with files by using relative file paths. Every relative file path has to be converted to an absolute file path by the PHP engine. When a PHP application uses many PHP files and accesses them by relative paths, the operation of resolving relative paths to absolute paths may negatively impact the application’s performance. The Windows Cache Extension for PHP provides a relative file path cache, which is used to store the mappings between relative and absolute file paths, thereby reducing the number of relative path resolutions that the PHP engine has to perform.
Download Windows Cache Extension for PHP version 1.0beta