How to prevent server from caching included files (PHP Apache)
Posted on 2005-03-22
I am developing a web application in php. The site is hosted on an Apache server. I utilize included files quite frequently in my code. I have noticed that even after I upload a new version of an included file, the old version is used for some period of time. This does not seem to happen with the main file itself. Is there a way to prevent this apparent caching of included files on the server? Please note, I am not talking about client (browser) caching.
For example, I have a page called manageUsers.php and near the top of this page I have the following php code:
db_incl.php contains many database specific functions and code. When I make a change to mangaeUsers.php and upload the new version of the page I view the page in my browser and I usually see the old version, then I it refresh on my browser and I see the new version of the page. When I make a change to db_incl.php and upload the new version, even when I hit refresh on my browser the page behaves as it did before I made the change. When I come back several hours later, the change is reflected on the page.
Obviously this makes development a pain. Is there a way to prevent this apparent caching?
Note that there is nothing in my code to prevent browser caching, and I prefer to stay away from that if possible.
PHP Version: 4.3.9
Apache Version: Apache/1.3.33 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 PHP/4.3.9 FrontPage/220.127.116.1135 mod_ssl/2.8.22 OpenSSL/0.9.7a
Browser Version: IE 6 running on XP Professional (SP2)