Monday 27 June 2005 12:27:21 pm
Hi folks, i am really happy with the static cache feature in ezp 3.6. The speed of my websites is fantastic now.
I've upgraded the sites
http://www.kuh.at http://www.galaxis.at from ezp 3.5 to 3.6. The speed improvement is incredible ... no more fear to be nailed by search engine robots and massive multiple page requests ...
Some tips and common pitfalls: -) If you use static cache, you have to remove all dynamic content. Sounds easy, but isn't. Most common "dynamic content" is the "user box" with the login inputs or info. I created an article and a special override template. That article isn't cached and shows the login-box if the user is anonymous or the user information (like edit page etc.) if he is logged in. -) If you have banners on your page you can show them with javascript. -) If you have counter on your page, use an external service (include it with javascript) - or write your own one.
-) If you like to expire the static cache by time (e.g. you like to have a new homepage at least once a day) - create a dummy class (which isnt shown on the user site) and publish an object of this dummy class once a day in a cronjob. (That's necerssary because deleting of the index.html isn't enough, it won't be recreated without publishing.) -) Don't use static cache if you have 2 different sites in the same database and you are using the virtual host system. -) Don't use staticcache if you use the "pathprefix" setting in site.ini. (I've filed a bug report already about that issue. http://ez.no/community/bugs/static_cache_path_prefix_isn_t_working_anymore ) -) If you have content like forum postings which can be created by registered users only: Think about allowing anonymous users to create them. -) After running the makestaticcache.php you will have a lot of session entries in your ezsession table. (The scipt simulates a normal http-request, so one new session entry is produced for each page which is cached ...) So, think about clearing the session table if you have to run the script often and you have to cache thousands of pages ... -) If you have a large site, think about the order of the static cache entries in the staticcache.ini.append:
CachedURLArray[]
CachedURLArray[]=/
CachedURLArray[]=/news
CachedURLArray[]=/news/*
CachedURLArray[]=/info CachedURLArray[]=/info/*
Better is:
CachedURLArray[]
CachedURLArray[]=/
CachedURLArray[]=/news
CachedURLArray[]=/info
CachedURLArray[]=/news/* CachedURLArray[]=/info/* So in that case the /info is cached before the children of "/news" by the script.
Best wishes,
Georg.
--
http://www.schicksal.com Horoskop website which uses eZ Publish since 2004
|