Monday 17 October 2005 3:41:02 am
Hi Lukasz Not working yet .. I did as you told me and created the 2 VHs which I submit below. I think I also found a couple bugs. maybe not. FRONT VH (to be statically cached):
DocumentRoot /usr/local/apache/htdocs/ezpublish-3.7.0/
ServerName front.prodigiweb.it
...........
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteLog /var/log/httpd/prod_logs/prod3.7.0.rewrite_log
RewriteLogLevel 2
# eZ publish >= 3.4.x :
RewriteCond /usr/local/apache/htdocs/ezpublish-3.7.0/static/index.html -f
RewriteRule ^/$ /static/index.html [L]
RewriteCond /usr/local/apache/htdocs/ezpublish-3.7.0/static/index.html -f
RewriteRule ^$ /static/index.html [L]
RewriteCond %{REQUEST_METHOD} !^POST$
RewriteCond /usr/local/apache/htdocs/ezpublish-3.7.0/static$1/index.html -f
RewriteRule ^(.*)$ /static$1/index.html [L]
RewriteRule !(^/design|^/var/.*/storage|^/var/storage|^/var/.*/cache|^/var/cache|^/extension/.*/design|^/kernel/setup/packages|^/packages|^/share/icons).*\.(gif|css|jpg|png|jar|js|ico|pdf|swf)$ /index.php
</IfModule>
..........
ADMIN VH (NOT to be statically cached):
DocumentRoot /usr/local/apache/htdocs/ezpublish-3.7.0/
ServerName beta.prodigiweb.it
...................
## I suppose that last rewrite-rule is still needed , even if I don't have Static Caching, right?
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteLog /var/log/httpd/prod/prod3.7.0.rewrite_log
RewriteLogLevel 2
RewriteRule !(^/design|^/var/.*/storage|^/var/storage|^/var/.*/cache|^/var/cache|^/extension/.*/design|^/kernel/setup/packages|^/packages|^/share/icons).*\.(gif|css|jpg|png|jar|js|ico|pdf|swf)$ /index.php
</IfModule>
.........
I was able to get the root page (corresponding to /) and node 2 of the frontend statically compiled by calling the makestaticcache.php script with -s corporate_user , with -f and without any parameters. but that's all. I submit the relevant parts of my config files: override/staticcache.ini.append.php
[CacheSettings]
HostName=localhost
StaticStorageDir=static
MaxCacheDepth=4
# A list of url's to cache. You can use the * wildcard to include a whole
# subtree.
CachedURLArray[]
CachedURLArray[]=/*
# A list of site accesses to generate static content for
CachedSiteAccesses[]
# A list of locations that will be updated whenever an object is published. You
# can NOT use a wildcard here.
AlwaysUpdateArray[]
AlwaysUpdateArray[]=/
override/site.ini.append.php
MatchOrder=host
HostMatchType=map
HostMatchMapItems[]=front.prodigiweb.it;corporate_user
HostMatchMapItems[]=beta.prodigiweb.it;corporate_admin
[ContentSettings]
StaticCache=enabled
I noticed this output when running the makestaticcache.php with the above configuration:
cache /users/administrator_users
cache /users/administrator_users/alberto_muci
cache /users/administrator_users/danilo
cache /users/administrator_users/massimiliano_bari
cache /users/administrator_users/utente_ammin
cache /users/anonymous_users
cache /users/anonymous_users/anonymous_user
This means that the script is caching, or at least scanning, my admin-side user nodes as well as my user-side content!! this is something I don't want. The script should recognize that those nodes are *not* to be scanned as they would never be accessed by an anonymous user - which is one of the tenets of static caching; only content accessible by anonymous users. Another thing: when I activate the static cache, all my accented characters in the only generated page messed up. this does not happen with static caching deactivated. I have an italian page, charset for db and templates is utf-8. Are they bugs which I have to report ? or did I do something wrong ? Also, question: In this site, I don't use the "full" templates for the nodes, but the "line" ones. there is no direct link to nodes, but only to the folders contaning the objects, which have a template which cycles and displays the "line" template of all the contained nodes. can this affect the working of the static cache? From the output of the makestaticcache.php file, the urls corresponding to the folder are scanned, so the static pages should be generated correctly. As you see, lots of things to ask and clarify. Please take the time to look into them in depth, I think it would be useful to other static-cachers around.
|