The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Strange Caching Issue for CSS files on VPS

Discussion in 'General Discussion' started by sm9, Oct 23, 2010.

  1. sm9

    sm9 Active Member

    Joined:
    Oct 10, 2009
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    Hi there,

    I've got a VPS running WHM and cPanel.

    For some reason, whenever I make changes to CSS files for websites that are on this server, the changes I make aren't reflected right away. This is making it a complete pain to edit websites.

    This isn't browser caching either, as I have tried deleting those caches and hard refreshes, but to no avail. I also don't have this issue when editing websites on other servers.

    When I check the headers for the CSS file I've modified, it has a status of '304 Not Modified.' I'm not sure if this can help point to the underlying issue?

    Any ideas on what the issue could be here and how I can fix it? I've never had an issue like this before with VPS's running WHM/cPanel.

    Thanks,

    Stephen
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    It might be related to this discussion (albeit old, it could well be valid):

    Caching CSS files -- stale CSS? HTML forum at WebmasterWorld

    Their suggestion is to change the name each time you make changes. Also, what is the PHP handler for the server in question? I'm just curious if it might be something like FCGI which caches by default.
     
  3. sm9

    sm9 Active Member

    Joined:
    Oct 10, 2009
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    Hi there,

    The problem is, I don't have to resort to giving CSS files unique names on other servers, and this exact site works fine in MAMP and on another VPS I have (neither are running PHP via CGI). But I now have 2 sites on this other VPS where these CSS changes just aren't refreshing after I make changes, even after making hard refreshes from the browser.

    I suspect there's a setting somewhere in WHM/cPanel that is causing this, maybe something to do with headers/caches and when they expire, but I'm not sure where to look or what I should be checking.

    I've just re-loaded the page and the CSS file gives the following headers:

    I then changed the background colour of the website and refreshed the page - this site on any other server, or other sites on any other server, would usually show the new background colour now, but it's not happening here. Here's the headers when I refreshed the page - you can see that it's still showing a 304 Not Modified status, and the If-Modified-Since time hasn't changed at all, despite me making a change to the CSS file and saving it:

    If I edit the CSS file several times, then every so many changes or minutes (I'm not sure which), it will eventually change, like this, and note the 200 OK status code instead of the 304 Not Modified.

    Also, here's the headers for another website on another WHM/cPanel VPS I have (which has no problems with the caching). I noticed that these headers don't have any lines for Cache-Control, If-Modified-Since or If-None-Match, so what would I need to change in WHM/cPanel in order to get rid of these?

    This issue also happens in Internet Explorer and Firefox (again, only to sites on this particular VPS), so it's not a browser issue.

    Any ideas on what I could check/amend wold be appreciated.

    Thanks,

    Stephen
     
  4. sm9

    sm9 Active Member

    Joined:
    Oct 10, 2009
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    Hi there,

    Any other ideas on this at all?

    Wondering if there's something simple I can check/uncheck in EasyApache, or a setting somewhere that I could look at, which could help me sort this.

    Thanks,

    Stephen
     
Loading...

Share This Page