1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

[solved] Can Cache-control: public cause dynamic pages being cached and thus non changing?

Discussion in 'Apache' started by postcd, Sep 30, 2020.

  1. #1
    SOLUTION AT THE BOTTOM OF THE POST

    Hello,

    when i click my website .php page details i see the response headers contains:
    cache-control public, max-age=2592000
    content-type: text/html; charset=utf-8; Cache-control:private
    x-powered-by: PHP/5.6.40

    request headers contain:
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
    Cache-Control: max-age=0

    and that dynamic (.php) page (and whole site) has problem with non refreshing on-page content. like i i do some onsite action that modify database content, but the change is not visible on site, even if i load the page again. I have to use F5 key for change to appear. The page seems to wrongly behave like html, not dynamic.

    When i lookup website files for "cache-control", this is what i see. I also searched for mentioned vlaue "2592000" but found no file to contain it. .htaccess and php.ini does not contain caching related rules per this output). BUT i have suspection that it is inherit from parent folder .htaccess because this script is on subdomain (subfolder of main domain) Main domain .htaccess is here please.

    Site is utilizing memcache and i found two files that seem to be responsible for this utilization:
    first one
    second one (just revant phrases)

    I have seen cloudflare cookie, maybe it is remains from the time i had cloudflar enabled on it. Currently cloudflare is disabled on the DNS record.

    Please do you have idea what to try to change?

    ---
    SOLUTION: It seems that indeed since the site was a subdomain (in subfolder of primary domain) the site got .htacces caching parameters (apache mod_expires) from the parent primary domain directory. When i input same parameters to the child .htaccess, only modified it to cache the content for not 30 days, but just 5 seconds, it started working.
     
    Last edited: Sep 30, 2020
    postcd, Sep 30, 2020 IP