Can Cache-contrl: public cause dynamic pages being cached and thus non changing?


Results 1 to 1 of 1

Thread: Can Cache-contrl: public cause dynamic pages being cached and thus non changing?

  1. #1
    Join Date
    Apr 2014
    Posts
    34

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

    APPEARS TO BE SOLVED (SOLUTION AT THE BOTTOM)

    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-controlrivate
    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 by postcd; 09-30-2020 at 05:30 PM.

Tags for this Thread

Posting Permissions

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