Delayed display after changing PHP file in IIS7

I recently migrated 2 of our Windows 2000 Box to WIndows 2008 R2, running IIS7.5. One day one of our web developers was reporting that changes that he made on his PHP files will not display right away on a web browser. There is about 15-30 seconds delay between right after he hit CTRL-S(to save) the php file and when the changes appear on a web page. This can be very annoying when you are debugging codes.

I need to make sure that this is not a browser problem. So, I:

  • had 2 browsers(IE and chrome) opened up with cleared private data(cache, cookies, and all the good stuff).
  • ran the php page on chrome
  • edit the php page and save
  • refreshed chrome….. changes are not displayed
  • immediately run the same php page on IE, which still has cleared private data and still hasn’t been used for browsing anything. Changes are still not appearing.

I then waited for about 25 seconds, and refresh both browsers, and immediately see the changes. I know this has got to be server settings.

First thing that comes in mind is WinCache extension for PHP. Which is recommended by Microsoft to speed PHP execution. After looking at the documentation for this extension, it sounds like the wincache.chkinterval setting is the culprit. The documentation mentioned that this can be changed in PHP.INI. The default settings is 30 seconds, which makes me more suspicious of this entry.

So I added the following entry under Module Settings in my php.ini file, which change the check interval settings to 1 second, instead of 30:

;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;
[WINCACHE]
wincache.chkinterval = 1

After IIS apply the settings, that seems to have fix it. My colleague is back to happy zone again 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

*