Expand my Community achievements bar.

SOLVED

iParsys and dispatcher cache flush

Avatar

Level 1

Almost exact same question as iParsys and dispatcher

If we use iParsys for creating site header and footer and if there is any change in the iParsys content.

1. Dispatcher cache needs to be flushed for all the child pages using iparsys.

2. Do not want to clear dispatcher cache for pages not referring to that iparsys content.

How do we achieve that?

In Dispatcher if I set, /invalidate section rules as { /glob “*.html” /type “allow” } it will clear cache for all child pages even if they are not referring iparsys.

I have set statfileslevel at 4 and our content structure is as "/content/sitename/en/us" and iparsys header/footer resides at "/us" level.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

The iparsys is located at a higher level than all children which inherit the content of the iparsys. Therefor on any change of the iparsys (which affects and children) all children are invalidated by default dispatcher invalidation ruleset. So by default you don't need to pay special attention to dispatcher caching if you want to use the iparsys.

If you want don't want to invalidate pages, which are below that page with the iparsys, but do not contain an iparsys themselves (and therefor do not change upon change of the ancestor's iparsys), that is very hard. At least with an reasonable effort. Because you would need to implement 2 additional features:

* on invalidation tell the dispatcher exactly which pages to invalidate; the dispatcher does not know and does not care about iparsys and such, it just knows files. On the other hand you need to extend the invalidation logic on AEM to evaluate each child page if it contains an iparsys. Doable, but it takes a lot of work!.

* On the other hand you need a special invalidation handler on dispatcher side, which just invalidates the pages which should be invalidated (as instructed by AEM via the invalidation request). Also there's the limit that you invalidate only per-directory. That means that when you invalidate a single file in a directory, all other files in the same directory are invalidated as well.

I would say, that this is a lot of effort for a very low improvement of the cache hit ratio. Of course your usecase can be so special that this improvement of caching outweighs the cost of implementing it. But for all usecases I am aware of this time could be spent somewhere else much better (e.g. by optimizing rendering time).

regards,

Jörg

View solution in original post

4 Replies

Avatar

Administrator

Duplicate question: iParsys and dispatcher

As per the comments, when you activate a page /content/mybrand/page where you have this iparsys configured, all pages below /content/mybrand/page should be invalidated.

Checklist:

  • Set dispatcher log level to 3 and check that it displays an incoming invalidation request.
  • Compare the statfiles in the cache directory and list their last-modification date.
  • All should be newer than the last-modification time of the cache files.

Reference Post:- Dispatcher Caching Issues

Jörg Hoh​ Help needed!!



Kautuk Sahni

Avatar

Correct answer by
Employee Advisor

The iparsys is located at a higher level than all children which inherit the content of the iparsys. Therefor on any change of the iparsys (which affects and children) all children are invalidated by default dispatcher invalidation ruleset. So by default you don't need to pay special attention to dispatcher caching if you want to use the iparsys.

If you want don't want to invalidate pages, which are below that page with the iparsys, but do not contain an iparsys themselves (and therefor do not change upon change of the ancestor's iparsys), that is very hard. At least with an reasonable effort. Because you would need to implement 2 additional features:

* on invalidation tell the dispatcher exactly which pages to invalidate; the dispatcher does not know and does not care about iparsys and such, it just knows files. On the other hand you need to extend the invalidation logic on AEM to evaluate each child page if it contains an iparsys. Doable, but it takes a lot of work!.

* On the other hand you need a special invalidation handler on dispatcher side, which just invalidates the pages which should be invalidated (as instructed by AEM via the invalidation request). Also there's the limit that you invalidate only per-directory. That means that when you invalidate a single file in a directory, all other files in the same directory are invalidated as well.

I would say, that this is a lot of effort for a very low improvement of the cache hit ratio. Of course your usecase can be so special that this improvement of caching outweighs the cost of implementing it. But for all usecases I am aware of this time could be spent somewhere else much better (e.g. by optimizing rendering time).

regards,

Jörg

Avatar

Level 1

Agree on the effort point.

Just wanted to know if its already supported or handled by AEM somehow. This will be good to have by default specially in case of iparsys rather than purging cache for all child pages.

I might go ahead with Workflow implementation where I check based on page template type (it gives me control on iparsys usage in my project) and purge Dispatcher cache if iparsys is used accordingly.

Avatar

Employee Advisor

I am not aware of that functionality being part of the AEM product.