Results 1 to 9 of 9
  1. #1
    Join Date
    Dec 2009
    Posts
    204
    Plugin Contributions
    0

    Default Wrong Cache-Control HTTP Response

    Hi, I've recently discovered that the http response for cache-control for my site is "private, max-age=10800, pre-check=10800", where normally it shold be "no-store, no-cache, must-revalidate, post-check=0, pre-check=0". This causes pages to get cached and not updating on refresh, but only when i'm clearing the cache.
    For example, new products page does not update after I list a new product on refresh, in fact all the pages do not show any changes untill clearing cache.
    Where can i start looking for a solution for this problem? Is it something I have control over, or is it a hosting issue?
    Furthermore, I saw some pages with zenid being cached in google when doing a search for: site:lemy.co.uk "zenid". I'm not sure these 2 problems are related, Prevent Spider Sessions in admin is set to True. Site is the first one in my signature, any pointers appreciated!

  2. #2
    Join Date
    Dec 2009
    Posts
    204
    Plugin Contributions
    0

    Default Re: Wrong Cache-Control HTTP Response

    Update: After speaking with my hosting company, they said something in my configuration is affectiing that response. They replaced the my index.php to test it and there was no "private, max-age=10800, pre-check=10800" showing up. I have 2 Cache-Control responses now: one is "private, max-age=10800, pre-check=10800" and the other is "max-age=0, no-store"
    Now the changes i make in the html are reflecting on refresh, but still, would like to get to the bottom of this.

  3. #3
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Wrong Cache-Control HTTP Response

    I would compare the index.php file in question to one from a fresh distribution of the same version
    Zen-Venom Get Bitten

  4. #4
    Join Date
    Dec 2009
    Posts
    204
    Plugin Contributions
    0

    Default Re: Wrong Cache-Control HTTP Response

    Thanks, I compared them and they are the same. Replaced mine with an original index.php and web-sniffer.net still shows this:
    Code:
    Status: HTTP/1.1 200 OK  
    Date: Sun, 19 Sep 2010 03:39:55 GMT  
    Server: Apache/2.2.15 (Unix) mod_ssl/2.2.15 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4  
    X-Powered-By: PHP/5.2.13  
    Expires: Thu, 19 Nov 1981 08:52:00 GMT  
    Cache-Control: private, max-age=10800, pre-check=10800  
    Set-Cookie: zenid=1cc8241a0860a07be1d798b32274a9d7; path=/; domain=lemy.co.uk  
    Last-Modified: Sun, 19 Sep 2010 03:39:32 GMT  
    Cache-Control: max-age=0, no-store  
    Connection: close  
    Transfer-Encoding: chunked  
    Content-Type: text/html; charset=utf-8
    Also compared application_top.php, which is unchanged.

  5. #5
    Join Date
    Apr 2006
    Location
    West Salem, IL
    Posts
    2,888
    Plugin Contributions
    0

    Default Re: Wrong Cache-Control HTTP Response

    What is in the .htaccess file for the site?
    Mike
    AEIIA - Zen Cart Certified & PCI Compliant Hosting
    The Zen Cart Forum...Better than a monitor covered with post-it notes!

  6. #6
    Join Date
    Dec 2009
    Posts
    204
    Plugin Contributions
    0

    Default Re: Wrong Cache-Control HTTP Response

    Canonical redirects, 404 page, Etags and ip denies, ultimate seo urls:
    Code:
    ErrorDocument 404 /index.php?main_page=page_not_found
    FileETag none
    RewriteEngine On
    
    # Index Redirect for /index.(html?|php) with no parameters
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.(html?|php)\ HTTP/
    RewriteRule ^index\.(html?|php)$ http://lemy.co.uk/? [R=301,L]
    
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(index.php)?\?ref=nf\ HTTP/
    RewriteRule ^(index.php)?$ http://lemy.co.uk/? [R=301,L]
    
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(index.php)?\?source=PrimeSiteUK.com\ HTTP/
    RewriteRule ^(index.php)?$ http://lemy.co.uk/? [R=301,L]
    
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(index.php)?\-c-16.html\ HTTP/
    RewriteRule ^(index.php)?$ http://lemy.co.uk/women-c-132.html? [R=301,L]
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(index.php)?\-c-128_129_162.html\ HTTP/
    RewriteRule ^(index.php)?$ http://lemy.co.uk/kids-toys-and-games-c-128_129.html? [R=301,L]
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(index.php)?\-c-.html\ HTTP/
    RewriteRule ^(index.php)?$ http://lemy.co.uk/footwear-globe-c-64_131.html? [R=301,L]
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(index.php)?\-c-13_9_31.html\ HTTP/
    RewriteRule ^(index.php)?$ http://lemy.co.uk/bikes-bicycle-accessories-c-13_9.html? [R=301,L]
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(index.php)?\-c-13_9_40.html\ HTTP/
    RewriteRule ^(index.php)?$ http://lemy.co.uk/bikes-bicycle-accessories-c-13_9.html? [R=301,L]
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(index.php)?\-c-13_9_84.html\ HTTP/
    RewriteRule ^(index.php)?$ http://lemy.co.uk/bikes-bicycle-accessories-c-13_9.html? [R=301,L]
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(index.php)?\-c-9_12.html\ HTTP/
    RewriteRule ^(index.php)?$ http://lemy.co.uk/bikes-bicycle-accessories-c-13_9.html? [R=301,L]
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(index.php)?\-c-9_28.html\ HTTP/
    RewriteRule ^(index.php)?$ http://lemy.co.uk/bikes-bicycle-accessories-c-13_9.html? [R=301,L]
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(index.php)?\-m-6.html\ HTTP/
    RewriteRule ^(index.php)?$ http://lemy.co.uk/disney-m-5.html? [R=301,L]
    
    # Index Redirect for /(index.php)?main_page=index(&cPath=<blank>) URL
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(index\.php)?\?main_page=index(&cPath=)?\ HTTP/
    RewriteRule ^(index\.php)?$ http://lemy.co.uk/? [R=301,L]
    
    # Canonical Redirect non-blank, www and/or appended port number to non-www [EXCLUDE /admin requests]
    RewriteCond %{HTTP_HOST}   !^(lemy\.co.uk)?$
    RewriteCond %{REQUEST_URI} !^/admin [NC]
    RewriteRule (.*) http://lemy.co.uk/$1 [R=301,L]
    
    Options +FollowSymLinks
    RewriteBase /
    # From Ultimate SEO URLs
    RewriteRule ^(.*)-p-(.*).html$ index\.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]
    RewriteRule ^(.*)-c-(.*).html$ index\.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]
    RewriteRule ^(.*)-m-([0-9]+).html$ index\.php?main_page=index&manufacturers_id=$2&%{QUERY_STRING} [L]
    RewriteRule ^(.*)-pi-([0-9]+).html$ index\.php?main_page=popup_image&pID=$2&%{QUERY_STRING} [L]
    RewriteRule ^(.*)-pr-([0-9]+).html$ index\.php?main_page=product_reviews&products_id=$2&%{QUERY_STRING} [L]
    RewriteRule ^(.*)-pri-([0-9]+).html$ index\.php?main_page=product_reviews_info&products_id=$2&%{QUERY_STRING} [L]
    
    # For Open Operations Info Manager
    RewriteRule ^(.*)-i-([0-9]+).html$ index\.php?main_page=info_manager&pages_id=$2&%{QUERY_STRING} [L]
    
    # For dreamscape's News & Articles Manager
    RewriteRule ^news/?$ index\.php?main_page=news&%{QUERY_STRING} [L]
    RewriteRule ^news/rss.xml$ index\.php?main_page=news_rss&%{QUERY_STRING} [L]
    RewriteRule ^news/archive/?$ index\.php?main_page=news_archive&%{QUERY_STRING} [L]
    RewriteRule ^news/([0-9]{4})-([0-9]{2})-([0-9]{2}).html$ index\.php?main_page=news&date=$1-$2-$3&%{QUERY_STRING} [L]
    RewriteRule ^news/archive/([0-9]{4})-([0-9]{2}).html$ index\.php?main_page=news_archive&date=$1-$2&%{QUERY_STRING} [L]
    RewriteRule ^news/(.*)-a-([0-9]+)-comments.html$ index\.php?main_page=news_comments&article_id=$2&%{QUERY_STRING} [L]
    RewriteRule ^news/(.*)-a-([0-9]+).html$ index\.php?main_page=news_article&article_id=$2&%{QUERY_STRING} [L]
    
    # All other pages
    # Don't rewrite real files or directories
    RewriteCond %{REQUEST_FILENAME} !-f [NC] 
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*).html$ index\.php?main_page=$1&%{QUERY_STRING} [L]
    
    order allow,deny
    deny from 114.80.93.
    deny from 174.129.139.
    deny from 75.101.195.
    deny from 219.133.48.
    deny from 222.76.218.
    allow from all

  7. #7
    Join Date
    Apr 2006
    Location
    West Salem, IL
    Posts
    2,888
    Plugin Contributions
    0

    Default Re: Wrong Cache-Control HTTP Response

    in the developers tool kit, in the admin, goto tools>developers toolkit and goto the bottom input field and enter
    Code:
    header("Cache-Control
    select allfiles-catalog/admin and click search.
    It will show everywhere in the files that its used.
    Mike
    AEIIA - Zen Cart Certified & PCI Compliant Hosting
    The Zen Cart Forum...Better than a monitor covered with post-it notes!

  8. #8
    Join Date
    Dec 2009
    Posts
    204
    Plugin Contributions
    0

    Default Re: Wrong Cache-Control HTTP Response

    Thanks, I've done that, it only shows backup_mysql.php, modules/pages/download/header_php.php, includes/classes/captcha.php, and phplot.php, all of which I checked and are unchanged from the originals.
    I'm wondering if caching everything like this is a bad thing, it makes the site much faster. Now the host forced the Cache-Control: max-age=0, no-store, which means nothing is cached, not even css, so browsing the site is slower.
    What are the disadvantages of having "private, max-age=10800, pre-check=10800" ?

  9. #9
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Wrong Cache-Control HTTP Response

    Quote Originally Posted by andreitero View Post
    I've recently discovered that the http response for cache-control for my site is "private, max-age=10800, pre-check=10800", where normally it shold be "no-store, no-cache, must-revalidate, post-check=0, pre-check=0". This causes pages to get cached and not updating on refresh, but only when i'm clearing the cache.
    Zen Cart doesn't set any cache-control responses except for when it serves up downloadable files.
    Whatever problem you're having is a result of your server configuration, whether controlled by your hosting company's settings or your own settings (such as .htaccess, php.ini, etc etc etc)
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. v150 As I can set the Expires and Cache-Control in my ZC (Windows, GoDaddy)?
    By juliooscar in forum General Questions
    Replies: 0
    Last Post: 14 Feb 2012, 12:47 AM
  2. HTTP POST Response Page for Credit Card Transactions
    By paulclane in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 20 Jan 2011, 03:25 PM
  3. Help! Page loads up fine,HTTP Response Code 404! Ultimate SEO URLs
    By jimdy in forum All Other Contributions/Addons
    Replies: 9
    Last Post: 22 Nov 2010, 10:05 AM
  4. Replies: 4
    Last Post: 13 Sep 2008, 04:40 AM
  5. Replies: 1
    Last Post: 26 Jun 2007, 05:06 PM

Posting Permissions

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