HTML Cache header problems. Need a force refresh to get the actual webpage content

Author Message

Romeo Antony

Wednesday 23 March 2011 4:31:18 am

Hi,

My site is having some serious issues with cache headers.

site is configured with squid as reverse proxy

Even after I logged out from the site, it shows me as logged in. when I do a force refresh, squid clears the requested url from is cahes and fetch the webpage from apache webserver. So that I need to refresh each page that is already in the squid cache to clear it from squid cache to get originalwebpage.

This is the headers that ez send from siteaccess

[HTTPHeaderSettings]
# Enable/disable custom HTTP header data.
CustomHeader=enabled
# Cache-Control values are set directly
Cache-Control[]
Cache-Control[/]=
# Expires specifies time offset compared to current time
# Default expired 2 hours ago ( no caching )
Expires[]
Expires[/]=300
# Pragma values are set directly
Pragma[]
Pragma[/]=

And in apache I have configured cache headers as

# 1 YEAR
<FilesMatch "\.(ico|pdf|flv)$">
Header set Cache-Control "max-age=29030400, public"
</FilesMatch>
# 1 WEEK
<FilesMatch "\.(jpg|jpeg|png|gif|swf)$">
Header set Cache-Control "max-age=604800, public"
</FilesMatch>
# 2 DAYS
<FilesMatch "\.(xml|txt|css|js)$">
Header set Cache-Control "max-age=172800, proxy-revalidate"
</FilesMatch>
# 1 MIN
<FilesMatch "\.(html|htm|php)$">
Header set Cache-Control "max-age=3600, private, proxy-revalidate"
</FilesMatch>

In virtualhost configuration cache headers as

<IfModule mod_expires.c>
<LocationMatch "^/var/[^/]+/storage/images/.*">
# eZ Publish appends the version number to image URL (ezimage
# datatype) so when an image is updated, its URL changes to
ExpiresActive on
ExpiresDefault "now plus 10 years"
</LocationMatch>

<LocationMatch "^/extension/[^/]+/design/[^/]+/(stylesheets|images|javascripts?|flash)/.*">
# A good optimization if you don't change your design often
ExpiresActive on
ExpiresDefault "now plus 5 days"
</LocationMatch>

<LocationMatch "^/extension/[^/]+/design/[^/]+/lib/.*">
# Libraries get a new url (version number) on updates
ExpiresActive on
ExpiresDefault "now plus 90 days"
</LocationMatch>

<LocationMatch "^/design/[^/]+/(stylesheets|images|javascripts?|lib|flash)/.*">
# Same as above for bundled eZ Publish designs
ExpiresActive on
ExpiresDefault "now plus 7 days"
</LocationMatch>

<LocationMatch "^/share/icons/.*">
# Icons as used by admin interface, barly change
ExpiresActive on
ExpiresDefault "now plus 7 days"
</LocationMatch>

# When ezjscore.ini/[Packer]/AppendLastModifiedTime=enabled
# so that file names change when source files are modified
#<LocationMatch "^/var/[^/]+/cache/public/.*">
# Force ezjscore packer js/css files to be cached 30 days
# at client side
ExpiresActive on
ExpiresDefault "now plus 30 days"
#</LocationMatch>
</IfModule>

I would like to cache all html pages in squid .But squid should check from apache webserver that any changes is made upon the respective html files. If there any change in html, it should show the latest changes. I think following cache header is misconfigured.

<FilesMatch "\.(html|htm|php)$">
Header set Cache-Control "max-age=3600, private, proxy-revalidate"
</FilesMatch>

ANy ideas will be a great help.

Regards

Romeo

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 02:50:44
Script start
Timing: Jan 18 2025 02:50:44
Module start 'layout'
Timing: Jan 18 2025 02:50:44
Module start 'content'
Timing: Jan 18 2025 02:50:45
Module end 'content'
Timing: Jan 18 2025 02:50:45
Script end

Main resources:

Total runtime0.7730 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0042 592.3047152.6875
Module start 'layout' 0.00420.0026 744.992239.5625
Module start 'content' 0.00680.7649 784.5547458.4609
Module end 'content' 0.77170.0013 1,243.015612.3750
Script end 0.7730  1,255.3906 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.4049160.0002
Check MTime0.00140.1858160.0001
Mysql Total
Database connection0.00060.074310.0006
Mysqli_queries0.719293.0298460.0156
Looping result0.00030.0435440.0000
Template Total0.749997.020.3749
Template load0.00240.310720.0012
Template processing0.747596.692520.3737
Template load and register function0.00010.014610.0001
states
state_id_array0.00070.086310.0007
state_identifier_array0.00100.128520.0005
Override
Cache load0.00220.2831900.0000
Sytem overhead
Fetch class attribute can translate value0.00040.049010.0004
Fetch class attribute name0.00050.069720.0003
XML
Image XML parsing0.00050.059010.0005
class_abstraction
Instantiating content class attribute0.00000.000420.0000
General
dbfile0.00060.0773160.0000
String conversion0.00000.000840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs