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 15 2025 09:08:55
Script start
Timing: Jan 15 2025 09:08:55
Module start 'layout'
Timing: Jan 15 2025 09:08:55
Module start 'content'
Timing: Jan 15 2025 09:08:56
Module end 'content'
Timing: Jan 15 2025 09:08:56
Script end

Main resources:

Total runtime1.6955 sec
Peak memory usage6,144.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0070 685.5313183.7500
Module start 'layout' 0.00700.0029 869.281352.6797
Module start 'content' 0.01001.6839 921.96091,718.8047
Module end 'content' 1.69390.0015 2,640.765668.7578
Script end 1.6954  2,709.5234 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00530.3145160.0003
Check MTime0.00130.0743160.0001
Mysql Total
Database connection0.00100.057310.0010
Mysqli_queries1.617095.3741460.0352
Looping result0.00040.0250440.0000
Template Total1.640696.820.8203
Template load0.00400.234120.0020
Template processing1.636696.529120.8183
Template load and register function0.00130.075410.0013
states
state_id_array0.00230.133610.0023
state_identifier_array0.00110.065520.0006
Override
Cache load0.00360.2136900.0000
Sytem overhead
Fetch class attribute can translate value0.00040.026410.0004
Fetch class attribute name0.00150.089320.0008
XML
Image XML parsing0.00200.120610.0020
class_abstraction
Instantiating content class attribute0.00000.000220.0000
General
dbfile0.00310.1816160.0002
String conversion0.00000.000540.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