Texttoimage and Cluster

Author Message

Guglielmo Celata

Wednesday 11 October 2006 8:09:43 am

Hi,
I have experienced a problem using the texttoimage operator in a clustered environment, using the dbfile filehandler.
The architecture I use is: a webstorage machine, with the database and two frontend machines, serving the pages and retrieving storage and cache from the database, with a remote connection.
eZ version is 3.8.4.

The thing is, images created with the texttoimage operator are cached under var/cache/texttoimage/images, in the frontend cache directories.
So, if someone browses a page, say, on the first frontend server, the image is cached there and it appears the <i>information that the image is cached</i> is stored in the DB, somehow.
As a matter of fact, when a connection is made on the second frontend server, the image results cached, but the path exists only on the first machine, so the image is broken.

I've fixed this, by remotely synching the var/cache/texttoimage/images directories of the two machines every two minutes, but I guess this is quite a crude patch.

Another 'fix' could be to set the UseCache setting to false in the texttoimage.ini configuration file.

I have tried to browse the source code (lib/eztemplate/classes/eztemplateimageoperator.php) but didn't find any place where the information that the image was alredy created was written in the cache, so I can't figure out how a connection on a second machine would try to load the image directly from the file system, instead of generating it.

Is there a way in order to have texttoimage images cached in the DB?

Guglielmo Celata

Claudia Kosny

Wednesday 11 October 2006 12:10:18 pm

Hi Guglielmo

As far as I can see the cache check is done by checking whether the file exists, there is nothing done in a database at all. The cache checking is done in the function modify at the lines where it checks the settings for usecache and then calls up $this->hasImage(...)
On EZ 3.8.3 the line numbers are 234 and following. If I understand you right EZ thinks that there is a cached file so it might be a good idea to check the filepath that is checked in the hasImage function.

Could you also please post both paths - the one where the file should be cached and the one where EZ thinks it is cached. You should see the path in html files that are created.

Greetings from Luxembourg

Claudia

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