Interesting (I think) design issue regarding caches

Author Message

Massimiliano Bariola

Thursday 05 January 2006 1:42:10 am

Well, here we are. new project, new issues!

The client is migrating a huge amount of data from their old cms to ezpublish; one of the things they liked less was the need to manually publish the same content in different locations.

So I said "great! let's use multiple node locations!" but the answer was ... "no, still too manual. we want something like I put keywords in my content and all the folders in the site which are associated with those keywords will show a link to the content".

of course, developer-wise, this translates to creating a custom folder class with a keyword list attribute so that its template will fetch the objects which contain those keywords.

So far, looks good. now, enter cache.

Every time a new content object is entered / modified / published, I need a way to clear cache of all the "enhanced folder"' nodes who contain the any of the keywords related to the newly published object.

Egads! so far, it seems to me that it is not possible, but I might be wrong. I suspect the answer is in the SmartCacheClear settings tweaking and in that switch which says "cache as soon as an object is published", but I'd like to know if anyone ever tried anything like this. eZ Crew ?

Another possible solution would be to use cache blocks with keys depending on the node list which should be displayed by the folder, but this kinda voids the caching .....

Finally (yes I know) the best solution would be a post-publish custom workflow which generates additional node locations based on both all special folders' associated keywords and the published object's keywords. but will this solve my caching conundrum?

Thanks y'all for your input

Max

Xavier Dutoit

Thursday 05 January 2006 2:56:05 am

Hi,

I've done something similar with the enhanced object relation.

http://ez.no/community/contribs/datatypes/enhanced_objectrelation

here the idea is to fetch the reverse related object as "children".

On the smart cache, I set up to clear the content object and the related objects and it works fine.

This being said, you can set the locations while editing the content and create your custom template to set the locations.

The trick is to add:

<input type="hidden" name="useNodeAssigments" value='1' />

Then you can set placements. The doc is kind of laking last time I checked, so have a look at the forums and source code.

There are the variables I use:

<input type="hidden" name="MainAssignmentElementNumber" value="1" /> 
<input type="hidden" name="SortOrderMap" value="" />
<input type="hidden" name="SortFieldMap" value="" />
<select name="SetPlacementNodeIDArray[1]" ...

Good luck and keep us informed

X+

http://www.sydesy.com

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