Jump to content

PHP/IIS - Stylesheets and JS files get cached and cannot be changed?


Recommended Posts

I have a PHP site that naturally includes some CSS and JS files into the HTML. However, sometimes, I can save a CSS or JS file, and it does not show up on the website (e.g., if I change a CSS style in common.css, it does not get reflected on the website). It seems to do it randomly - most of the time the changes are reflected just fine. I can modify the PHP files just fine, it just seems to be CSS and JS files that are referenced.

 

Even if I delete the file and re-save it, it does not reflect the changes. I can run "iisreset" and changes are not reflected. Furthermore, changes are not reflected in any browser I use, on any machine on the network - so it has to be something with PHP or IIS (though I have never experienced this before with IIS using .net).

 

If I rename the file, and rename the link in the PHP code, it gets reflected. But, I cannot change it back, as it still seems to cache an old CSS file. This happens in FF, Safari, and IE7.

 

Can anyone give me any idea as to what the heck is going on here? This is making it very hard to develop. Thanks!

Not really PHP related, because it doesn't care about CSS files, but you sure it isn't your  browser?  Once you upload a new file, all contents are replaced.  Try setting your Browser to check for a new version each time you load a page instead of Automatic.

 

I know my site works instantly when I change any CSS setting.

Not really PHP related, because it doesn't care about CSS files, but you sure it isn't your  browser?  Once you upload a new file, all contents are replaced.  Try setting your Browser to check for a new version each time you load a page instead of Automatic.

 

I know my site works instantly when I change any CSS setting.

 

So far I rebooted the server and tried browsers on a bunch of machines. I cleared cache. I even loaded the CSS file directly into the browser and it's still displaying an old version. I open the file on the server itself and it reflects changes I made to it, but those changes are not being displayed in the browser window.

 

So, perhaps it is not a PHP related question then, still, very odd...

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.