Static Cache configuration

Author Message

Fabio Carissimi

Thursday 01 February 2007 12:29:45 am

Hi,

I have set up the static cache for my website like described in Bård Farstad's article.
(cf http://ez.no/community/articles/ez_publish_performance_optimization_part_3_of_3_practical_cache_and_template_solutions/static_cache ).

The sites is very fast now but there is something I still don't understand.
When an object is published the static cache file is not replaced.

I have many sites and siteaccesses on my server and what I want is to have only one site to be cached.
assuming I want the siteaccess 'mysite' to be cached and having 'myadminsite' for the admin interface.

I have settings like that :

in settings/ovverride/site.ini.append.php:
[ContentSettings]
StaticCache=enabled

in settings/ovverride/staticcache.ini.append.php:
[CacheSettings]
# A list of site accesses to generate static content for
CachedSiteAccesses[]
CachedSiteAccesses[]=mysite

CachedURLArray[]=/

in settings/siteaccess/myadminsite/site.ini.append.php:
[ContentSettings]
StaticCache=enabled

in settings/siteaccess/mysite/staticcache.ini.append.php:
[CacheSettings]
HostName=myhost.com
StaticStorageDir=static/mysite
MaxCacheDepth=5

# A list of url's to cache. You can use the * wildcard to include a whole
# subtree.
CachedURLArray[]=/
CachedURLArray[]=/mysubtree*

# A list of locations that will be updated whenever an object is published. You
# can NOT use a wildcard here.
AlwaysUpdateArray[]
AlwaysUpdateArray[]=/

What is missing or wrong ? What can I do to have the static cache files replaced when an object is published ?

Thanks for help

Fabio Carissimi

Fabio Carissimi

Friday 09 February 2007 9:48:56 am

Hello,
I have still the same configuration and I made the corrections suggested
in this issue http://issues.ez.no/9126 in the file kernel/classes/ezstaticcache.php.

But it is still not working,
Can somebody tell me what can I do to make it work ?

thanks

Fabio Carissimi

Wednesday 14 February 2007 9:05:52 am

there is still nobody who can help ???

Kristof Coomans

Wednesday 14 February 2007 11:06:53 pm

Hi Fabio

Which eZ publish version are you using?

Are you using URL based site accesses? If yes, good. If no, bad for the static caching system, it only works with URL based site accesses.

I'd try another approach with the settings. Place every setting related to static cache configuration in settings/override/staticcache.ini.append.php:

[CacheSettings]
HostName=myhost.com
StaticStorageDir=static
MaxCacheDepth=5

# A list of site accesses to generate static content for
CachedSiteAccesses[]
CachedSiteAccesses[]=mysite

CachedURLArray[]=/
CachedURLArray[]=/mysubtree*

AlwaysUpdateArray[]
AlwaysUpdateArray[]=/

Now the static cache will be created in the static folder. Right under the folder there are folders for each site access you are statically caching ( CachedSiteAccesses[] setting ). There's no need to append your site access name to the value of the StaticStorageDir setting.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Łukasz Serwatka

Thursday 15 February 2007 12:18:15 am

Are you using URL based site accesses? If yes, good. If no, bad for the static caching system, it only works with URL based site accesses.

Acually this is not entirely true. Static caching works with HOST access type, in this case you need 2 virtual hosts setup, one for public site and one for admin site to avoid problems with admin interface. I tested it with HOST and works as expected.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Kristof Coomans

Thursday 15 February 2007 12:36:43 am

I probably should have said: <i>does not seem to work very well</i>: http://issues.ez.no/7982

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Fabio Carissimi

Thursday 15 February 2007 3:19:35 am

Hello,

first of all, thanks for your help Kristof and Lukasz,

let me do a brief summary :
I am using <b>ezp 3.9</b> (php 4.3.9-cgi, mysql 4.1.20, Apache 2.0.52) and I am using host access type with a virtual host for each public site and for each admin site and I have still the same settings and <b>static cache is generated without any problem.</b>

The problem is when I try to update an object, static cache should be replaced but it is not always working.
I just tried it now :
the first time, I modify an object and publish it and static cache of this object is replaced.
But if I try it again a second time with an other modification, it is not working.
I tried again 10 mn later and it works.
Is it normal ? should I wait to do another publication ?
That's my problem. but maybe it isn't ...
can you tell me if this waiting time is normal ?
I just want to understand it better to avoid future problems ...

Thanks for help

PS :
Kristof, your different approach can't be applied to my server, because we have many sites which won't have same cache strategy.
If I put CachedURLArray[]=/news in override/staticcache.ini.append.php and site1 wants /news to be cached and site don't want it is not working. But I think you suggested it to
solve missing cache generation, and it is not the problem here

Fabio Carissimi

Thursday 22 February 2007 8:21:35 am

Hello,
I still have problems with static cache, it is not working very well,

now I have also a content/view/full directory tree created with a folder for
each node that contains index.html static cache,

I have both this folders and the folders I want to be created (mysubtree, mysubtree2, etc ...)

why is this created ?

thanks for help

Fabio Carissimi

Wednesday 07 March 2007 1:10:46 am

Hello,

I have still big problems with static cache,
when I update a page in the administration interface, the static cache is not replaced
for pages in AlwaysUpdateArray[].

There is also a problem because I setup to have CachedURLArray[]=/mysubtree*
and in static cache directory, I have a mysubtree directory but I also have a directory
content with content/viwe/full/NODE_ID/index.html ...

Result of all: when I want a page to be updated, i have to remove manually the static Cache AND empty cache in the administration.

I really don't know what to do

thanks for help ...

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