Results 1 to 14 of 14

Thread: Strange server caching problem.

  1. #1
    Join Date
    Dec 2017
    Posts
    7

    Strange server caching problem.

    Hi!

    Some weeks ago I did an update on my CustomBuild 2.0 set up (just an update, no change of config at all).
    And since than my server seems like caching files for 5 minutes before they update to the world.

    Example:
    For developing I'm using notepad++ with the FTP extension so I can do direct changes in PHP files and see them directly live after save ( = FTP upload ).

    But since the last update I did, I need to wait like 5 minutes before it updates in my browser.

    I first thought it was my browser caching things, but on the FTP of the company I work for, there are no any issues like this - there it updates immediately..

    I tried finding any settings of caching enabled, but I did not enable any caching settings myself, what I did see that there is/was mod_expires being loaded as (static) but I tried to disable that without any result.
    After reading some things for speeding up the server, today I switched from 'apache' mode to 'nginx_apache' mode but still the same issue.

    Strangest thing is, I haven't had this before, but now it really starts annoying me as developing slows down alot.. :/

    System running:
    Centos 6.0
    CustomBuild 2.0 (1774)
    DirectAdmin 1.52.1

    Thanks in advance!

    Kind regards

  2. #2
    Join Date
    Feb 2016
    Posts
    48
    How are you telling they are being cached? Are you looking at cache headers in your browser or just assuming?

    Do you have a .htaccess file in your document root? If so, what's in it?

  3. #3
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    11,388
    Hello,

    For developing I'm using notepad++ with the FTP extension so I can do direct changes in PHP files and see them directly live after save ( = FTP upload ).
    opcache enabled in PHP?


    Code:
    php -v
    With regards, Alex.

    Professional Server Management for web hosting companies and individuals
    Hourly Support, Disaster Recovery, Server Hardening, Monthly Subscription
    Directadmin installation and optimization

    Click here if you need a Linux Admin

  4. #4
    Join Date
    Dec 2017
    Posts
    7
    Quote Originally Posted by zEitEr View Post
    Hello,



    opcache enabled in PHP?


    Code:
    php -v
    Hi!

    This was the output,.. so I think it is..

    Code:
    PHP 5.6.32 (cli) (built: Oct 30 2017 22:07:03)
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
        with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
    All though, my settings say something else... ?

    https://screenshots.firefoxuserconte...603fc9c5a8.png

    Kind regards,

  5. #5
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    11,388
    you need to rebuild php or php.ini
    With regards, Alex.

    Professional Server Management for web hosting companies and individuals
    Hourly Support, Disaster Recovery, Server Hardening, Monthly Subscription
    Directadmin installation and optimization

    Click here if you need a Linux Admin

  6. #6
    Join Date
    Dec 2017
    Posts
    7
    Quote Originally Posted by zEitEr View Post
    you need to rebuild php or php.ini
    Hi, thanks.

    Just updated the configuration as OpCache was on indeed.

    Still, it doesn't instant update. So maybe anything else possible or should I disable the zend framework fully?


    Cache headers look like these so seems ok?
    Code:
    no-store, no-cache, must-revalidate, post-check=0, pre-check=0
    Or can this be the nginx I updated to yesterday? (Don't think so but, yeah..)

    Kind regards

  7. #7
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    11,388
    Are you sure that OPcache is now disabled? Did you check output?

    Code:
    php -v
    With regards, Alex.

    Professional Server Management for web hosting companies and individuals
    Hourly Support, Disaster Recovery, Server Hardening, Monthly Subscription
    Directadmin installation and optimization

    Click here if you need a Linux Admin

  8. #8
    Join Date
    May 2014
    Location
    Netherlands Germany
    Posts
    293
    Though if caching is off:

    You have to check with other browser, other Computer and other Internetprovider to be sure where this caching is done.

    So if same file is called from other computer, other internet provider maybe other browser then if you have caching probably this is then on the server. ( but still could be that your hoster or extra "box" between that is using caching to for whatever reasons even is cache of the server and so on is off.)

    If no same cached content then for sure if not at sessions/cookie cache you have to look somewhere else i think.
    DUTCH GERMAN, GERMAN DUTCH

  9. #9
    Join Date
    Dec 2017
    Posts
    7
    Quote Originally Posted by zEitEr View Post
    Are you sure that OPcache is now disabled? Did you check output?

    Code:
    php -v
    Yes, checked multiple times

    Quote Originally Posted by ikkeben View Post
    Though if caching is off:

    You have to check with other browser, other Computer and other Internetprovider to be sure where this caching is done.

    So if same file is called from other computer, other internet provider maybe other browser then if you have caching probably this is then on the server. ( but still could be that your hoster or extra "box" between that is using caching to for whatever reasons even is cache of the server and so on is off.)

    If no same cached content then for sure if not at sessions/cookie cache you have to look somewhere else i think.
    All has been checked, it's the server that caches ...

    We rent this Dedicated Server but can ask for help at the company where it is being hosted if we/I cannot find any solution.. :/

    Kind regards

  10. #10
    Join Date
    Dec 2017
    Posts
    7
    Hi!

    I found a solution!

    As I pasted the cache headers before, I created a .htaccess file and put the next inside:
    Code:
    Header set Cache-Control "no-cache"
    So all the rest which showed up is gone.

    Now everything works as it should.

    But the question now is, how can I do this permanent? Where can I change the standard cache-control setting ?

    Kind regards!

  11. #11
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    11,388
    You should check your application settings, I did not find anything in Apache which would make files to cache.
    With regards, Alex.

    Professional Server Management for web hosting companies and individuals
    Hourly Support, Disaster Recovery, Server Hardening, Monthly Subscription
    Directadmin installation and optimization

    Click here if you need a Linux Admin

  12. #12
    Join Date
    Dec 2017
    Posts
    7
    Quote Originally Posted by zEitEr View Post
    You should check your application settings, I did not find anything in Apache which would make files to cache.
    So maybe I need to enable and configure mod_expose so it will be standard ?

  13. #13
    Join Date
    Dec 2017
    Posts
    7
    Quote Originally Posted by Borre View Post
    So maybe I need to enable and configure mod_expose so it will be standard ?
    mod_expires

    (can't find the edit button?

  14. #14
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    11,388
    Apache is already built with mod_expires by default, check with:

    Code:
    # apachectl -M 2>&1 | grep expires
     expires_module (static)
    With regards, Alex.

    Professional Server Management for web hosting companies and individuals
    Hourly Support, Disaster Recovery, Server Hardening, Monthly Subscription
    Directadmin installation and optimization

    Click here if you need a Linux Admin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •