Search

I’d like to do some rather heavy processing as late as possible, preferrable after the data has been sent to the user. The latest delegate I could find is FrontendOutputPostGenerate, but this is right after the data has been generated and right before it’s sent to the user. Are there any delegates fired later than that?

I also tried to put the processing in a destructor method, but apparently the database object is destroyed before mine.

I’d appreciate any input.

What do you need to do specifically? Remember that you can customize Data Sources and Events.

Well, I’m trying to do some performance optimizations and for that this extension sometimes needs database access. (I have tried both CacheLite and Cacheable Datasource, but I want to try and see if I can increase performance even more.)

If there is no delegate after output has been sent I suppose I’ll have to clone the database object…

Without knowing exactly what your trying, surely optimisations would hook in before data is accessed, and not after the page has been built?

I’m trying to bypass php all together with some caching. It is only designed to cache static content.

The idea is to catch the output sent to the user and write it to a cache file, then add a RewriteRule in the .htaccess file to send the next users to that static cache file. This way php won’t be initialized for cached pages. This was the easy part. The harder part is to refresh only the related cache files when an entry is updated, and for that I need a database with an overview of where (ie. cache files) each entry is used, which makes quite a few rows to update/insert into the database. In my case I have a site with quite a few entries on each page (galleries, etc.) so the database update creates quite a large overhead.

So far it works great. It catches output, writes it to a cache file, adds rules to .htaccess and updates the database. When a user visits a cached page, php is bypassed and everything is about as fast as I can make it. However, the problem is when a user visits an uncached page, which causes this rather slow caching procedure to run before the output generated by symphony is sent to the user. I would very much like to delay this cache related processing as late as possible.

Nice one. We added similar functionality to CacheLite such that it logs which sections/entries are used on each page so those caches can be destroyed when entries are updated. This could be modified further so that CacheLite stores its files on disk the same as the URL structure (instead of hashed names in the cache folder) so they are loaded directly; no .htaccess writing necessary. This is how Wordpress’ SuperCache works which is pretty good.

Thanks, but I chose to go with RewriteRules because I want to later add support for GET parameters and cookies, if I have the time. I’d like to add the possibility for an admin to add cookie-names and GET parameter keys to the “uri to cache mapping algorithm”. This way this cache extension could perhaps work with more dynamic sites.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details