Static cache with index.php in URL path

Author Message

Geraint Edwards

Wednesday 29 June 2005 3:44:54 am

I finally got static caching to work (V. NICE enhancement) and thought I'd share an insight.

The helpful setup summary at http://ez.no/ez_publish/download/changelogs/ez_publish_3_6/new_features/static_caching_of_content
assumes a URL path that does not include index.php - if you are forced to include the index.php in your path because of your hosting configuration the instructions won't quite work.

The following rewrite rules works for me and may help others in the same situation:

RewriteCond %{REQUEST_URI} !\.(gif|jpe?g|png|css|js|html|ico|jar|xml)|index\.php|\.pdf$
RewriteRule ^(.*) /index.php/$1 

RewriteCond   /var/www/ezCloc/static/{siteaccess}/index.html -f
RewriteRule  ^/$              /static/{siteaccess}/index.html [L]
RewriteCond   /var/www/ezCloc/static/{siteaccess}/index.html -f
RewriteRule  ^$               /static/{siteaccess}/index.html [L]

RewriteCond   %{REQUEST_METHOD}       !^POST$
RewriteCond %{REQUEST_URI} !\.(gif|css|jpg|png|jar|ico|js|html|xml)$
RewriteCond %{REQUEST_URI} ^\/index.php\/(.*)
RewriteCond   {rootDir}/static/$1/index.html -f
RewriteRule   ^index.php\/(.*)$  /static/$1/index.html [L]

Hope that helps someone.

p.s. Of course <b>I now need to start to strip out unnecssary POST requests that merely obtain static content e.g. for displaying images in the gallery etc.</b>

Geraint

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 19 2025 00:27:35
Script start
Timing: Jan 19 2025 00:27:36
Module start 'layout'
Timing: Jan 19 2025 00:27:36
Module start 'content'
Timing: Jan 19 2025 00:27:37
Module end 'content'
Timing: Jan 19 2025 00:27:37
Script end

Main resources:

Total runtime1.5509 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.0071 594.1016152.6406
Module start 'layout' 0.00710.0038 746.742239.4766
Module start 'content' 0.01081.5376 786.2188407.0000
Module end 'content' 1.54840.0024 1,193.21888.1406
Script end 1.5509  1,201.3594 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.1996160.0002
Check MTime0.00130.0820160.0001
Mysql Total
Database connection0.00160.103010.0016
Mysqli_queries1.511297.4350460.0329
Looping result0.00040.0272440.0000
Template Total1.513597.620.7568
Template load0.00160.104920.0008
Template processing1.511997.481920.7559
Template load and register function0.00020.010210.0002
states
state_id_array0.00130.082510.0013
state_identifier_array0.00270.174720.0014
Override
Cache load0.00130.0835110.0001
Sytem overhead
Fetch class attribute can translate value0.00050.035010.0005
Fetch class attribute name0.00050.031110.0005
XML
Image XML parsing0.00010.008510.0001
class_abstraction
Instantiating content class attribute0.00000.000210.0000
General
dbfile0.00070.0453100.0001
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/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 8
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs