Expand my Community achievements bar.

SOLVED

Dispatcher statfileslevel

Avatar

Level 3

Have a question on dispatcher statfileslevel

I am configuring dispatcher and doing some tests. I have set the statfileslevel as 7.

When I activate /content/we-retail/language-masters/en/products/women/shorts/candide-trail-short.html, the dispatcher touches all the stat files in content, we-retail, language-masters, en, products, women, shorts

Then I have accessed /content/we-retail/language-masters/en/products/men.html and men.html file in docroot was invalidated and pulled from publish server

When I accessed /content/we-retail/language-masters/en/products/men/coats/slopeside-coat.html, the cache is not invalidated and served from cache due to the fact that stat level is 7 and the statfile in /content/we-retail/language-masters/en/products/men/coats is not touched due to activation of /content/we-retail/language-masters/en/products/women/shorts/candide-trail-short

My question is why men.html is invalidated though it is not related to any content on /content/we-retail/language-masters/en/products/women/shorts/candide-trail-short and can we avoid this?

As these would be the highly viewed pages on the site, I want to avoid their invalidation when other page in the hierarchy is activated,

1 Accepted Solution

Avatar

Correct answer by
Level 10

Check if you have configured the header properly. Enable debug/trace logs and debug what's happening because it works fine for me

Dispatcher logs with ResourceOnly enabled

[D] [pid 26952 (tid 1152)] checking [/dispatcher/invalidate.cache]

[I] [pid 26952 (tid 1152)] Activation detected: action=Activate [/content/we-retail/us/en/products/men/coats/portland-hooded-jacket]

[D] [pid 26952 (tid 1152)] response.status = 200

[D] [pid 26952 (tid 1152)] response.headers[Server] = "Communique/2.6.3 (build 5221)"

[D] [pid 26952 (tid 1152)] response.headers[Content-Type] = "text/html"

[D] [pid 26952 (tid 1152)] cache flushed

[I] [pid 26952 (tid 1152)] "GET /dispatcher/invalidate.cache" 200 13 1ms [website/-]

and

2019-02-01 20:03:38 - INFO - flush : Creating content for path /content/we-retail/us/en/products/men/coats/portland-hooded-jacket

2019-02-01 20:03:38 - DEBUG - flush : adding header: CQ-Action:Activate

2019-02-01 20:03:38 - DEBUG - flush : adding header: CQ-Handle:/content/we-retail/us/en/products/men/coats/portland-hooded-jacket

2019-02-01 20:03:38 - DEBUG - flush : adding header: CQ-Path:/content/we-retail/us/en/products/men/coats/portland-hooded-jacket

2019-02-01 20:03:38 - DEBUG - flush : adding header: CQ-Action-Scope:ResourceOnly

2019-02-01 20:03:38 - DEBUG - flush : deserialize content for delivery

2019-02-01 20:03:38 - DEBUG - flush : No message body: Content ReplicationContent.VOID is empty

2019-02-01 20:03:38 - INFO - flush : Sending GET request to http://localhost:80/dispatcher/invalidate.cache

2019-02-01 20:03:38 - INFO - flush : sent. Response: 200 OK

2019-02-01 20:03:38 - INFO - flush : ------------------------------------------------

2019-02-01 20:03:38 - INFO - flush : Sending message to localhost:80

2019-02-01 20:03:38 - INFO - flush : >> GET /dispatcher/invalidate.cache HTTP/1.0

2019-02-01 20:03:38 - INFO - flush : >> CQ-Action: Activate

2019-02-01 20:03:38 - INFO - flush : >> CQ-Handle: /content/we-retail/us/en/products/men/coats/portland-hooded-jacket

2019-02-01 20:03:38 - INFO - flush : >> CQ-Path: /content/we-retail/us/en/products/men/coats/portland-hooded-jacket

2019-02-01 20:03:38 - INFO - flush : >> CQ-Action-Scope: ResourceOnly

2019-02-01 20:03:38 - INFO - flush : >> Referer: about:blank

2019-02-01 20:03:38 - INFO - flush : >> Content-Length: 0

2019-02-01 20:03:38 - INFO - flush : >> Content-Type: application/octet-stream

2019-02-01 20:03:38 - INFO - flush : --

2019-02-01 20:03:38 - INFO - flush : << HTTP/1.1 200 OK

2019-02-01 20:03:38 - INFO - flush : << Date: Sat, 02 Feb 2019 01:03:38 GMT

2019-02-01 20:03:38 - INFO - flush : << Server: Apache

2019-02-01 20:03:38 - INFO - flush : << Content-Length: 13

2019-02-01 20:03:38 - INFO - flush : << Content-Type: text/html; charset=utf-8

2019-02-01 20:03:38 - INFO - flush : <<

2019-02-01 20:03:38 - INFO - flush : <<

2019-02-01 20:03:38 - INFO - flush : Message sent.

2019-02-01 20:03:38 - INFO - flush : ------------------------------------------------

2019-02-01 20:03:38 - INFO - flush : Replication (ACTIVATE) of /content/we-retail/us/en/products/men/coats/portland-hooded-jacket successful.

Dispatcher logs without ResourceOnly header

[D] [pid 26952 (tid 1152)] Found farm website for localhost

[D] [pid 26952 (tid 1152)] checking [/dispatcher/invalidate.cache]

[I] [pid 26952 (tid 1152)] Activation detected: action=Activate [/content/we-retail/us/en/products/men/coats/portland-hooded-jacket]

[I] [pid 26952 (tid 1152)] Touched c:\installed_setups\Apache2.2\htdocs\.stat

[I] [pid 26952 (tid 1152)] Touched c:\installed_setups\Apache2.2\htdocs\content\.stat

[I] [pid 26952 (tid 1152)] Touched c:\installed_setups\Apache2.2\htdocs\content\we-retail\.stat

[I] [pid 26952 (tid 1152)] Touched c:\installed_setups\Apache2.2\htdocs\content\we-retail\us\.stat

[D] [pid 26952 (tid 1152)] response.status = 200

[D] [pid 26952 (tid 1152)] response.headers[Server] = "Communique/2.6.3 (build 5221)"

[D] [pid 26952 (tid 1152)] response.headers[Content-Type] = "text/html"

[D] [pid 26952 (tid 1152)] cache flushed

[I] [pid 26952 (tid 1152)] "GET /dispatcher/invalidate.cache" 200 13 26ms [website/-]

and

2019-02-01 20:04:28 - INFO - flush : Agent started.

2019-02-01 20:04:36 - INFO - flush : Creating content for path /content/we-retail/us/en/products/men/coats/portland-hooded-jacket

2019-02-01 20:04:36 - INFO - flush : Create new HttpClient for Dispatcher Flush

2019-02-01 20:04:36 - INFO - flush : * HTTP Version: 1.1

2019-02-01 20:04:36 - DEBUG - flush : adding header: CQ-Action:Activate

2019-02-01 20:04:36 - DEBUG - flush : adding header: CQ-Handle:/content/we-retail/us/en/products/men/coats/portland-hooded-jacket

2019-02-01 20:04:36 - DEBUG - flush : adding header: CQ-Path:/content/we-retail/us/en/products/men/coats/portland-hooded-jacket

2019-02-01 20:04:36 - DEBUG - flush : deserialize content for delivery

2019-02-01 20:04:36 - DEBUG - flush : No message body: Content ReplicationContent.VOID is empty

2019-02-01 20:04:36 - INFO - flush : Sending GET request to http://localhost:80/dispatcher/invalidate.cache

2019-02-01 20:04:37 - INFO - flush : sent. Response: 200 OK

2019-02-01 20:04:37 - INFO - flush : ------------------------------------------------

2019-02-01 20:04:37 - INFO - flush : Sending message to localhost:80

2019-02-01 20:04:37 - INFO - flush : >> GET /dispatcher/invalidate.cache HTTP/1.0

2019-02-01 20:04:37 - INFO - flush : >> CQ-Action: Activate

2019-02-01 20:04:37 - INFO - flush : >> CQ-Handle: /content/we-retail/us/en/products/men/coats/portland-hooded-jacket

2019-02-01 20:04:37 - INFO - flush : >> CQ-Path: /content/we-retail/us/en/products/men/coats/portland-hooded-jacket

2019-02-01 20:04:37 - INFO - flush : >> Referer: about:blank

2019-02-01 20:04:37 - INFO - flush : >> Content-Length: 0

2019-02-01 20:04:37 - INFO - flush : >> Content-Type: application/octet-stream

2019-02-01 20:04:37 - INFO - flush : --

2019-02-01 20:04:37 - INFO - flush : << HTTP/1.1 200 OK

2019-02-01 20:04:37 - INFO - flush : << Date: Sat, 02 Feb 2019 01:04:37 GMT

2019-02-01 20:04:37 - INFO - flush : << Server: Apache

2019-02-01 20:04:37 - INFO - flush : << Content-Length: 13

2019-02-01 20:04:37 - INFO - flush : << Content-Type: text/html; charset=utf-8

2019-02-01 20:04:37 - INFO - flush : <<

2019-02-01 20:04:37 - INFO - flush : <<

2019-02-01 20:04:37 - INFO - flush : Message sent.

2019-02-01 20:04:37 - INFO - flush : ------------------------------------------------

2019-02-01 20:04:37 - INFO - flush : Replication (ACTIVATE) of /content/we-retail/us/en/products/men/coats/portland-hooded-jacket successful.

View solution in original post

3 Replies

Avatar

Level 10

That is the default behavior of dispatcher to touch all .stat files starting from child to root.

try this-

1) Add Header CQ-Action-Scope:ResourceOnly

Invalidation (i.e. touching of .stat files) can be prevented by sending an additional Header CQ-Action-Scope: ResourceOnly. This can be used to flush particular resources without invalidating other parts of the cache, like JSON data that is dynamically created and requires regular flushing independent of the cache

source:

Configuring Dispatcher

Invalidating Cached Pages From AEM

Avatar

Level 3

Thanks for the reply.

I added the header CQ-Action-Scope:ResourceOnly to dispatcher flush agent by editing the flush agent config. The agent is configured on author and I activated the agent post edit.

I still see the invalidate request is touching all the .stat files in the hierarchy when I verify dispatcher logs and even the content is invalidated.

Am I missing something here?

Avatar

Correct answer by
Level 10

Check if you have configured the header properly. Enable debug/trace logs and debug what's happening because it works fine for me

Dispatcher logs with ResourceOnly enabled

[D] [pid 26952 (tid 1152)] checking [/dispatcher/invalidate.cache]

[I] [pid 26952 (tid 1152)] Activation detected: action=Activate [/content/we-retail/us/en/products/men/coats/portland-hooded-jacket]

[D] [pid 26952 (tid 1152)] response.status = 200

[D] [pid 26952 (tid 1152)] response.headers[Server] = "Communique/2.6.3 (build 5221)"

[D] [pid 26952 (tid 1152)] response.headers[Content-Type] = "text/html"

[D] [pid 26952 (tid 1152)] cache flushed

[I] [pid 26952 (tid 1152)] "GET /dispatcher/invalidate.cache" 200 13 1ms [website/-]

and

2019-02-01 20:03:38 - INFO - flush : Creating content for path /content/we-retail/us/en/products/men/coats/portland-hooded-jacket

2019-02-01 20:03:38 - DEBUG - flush : adding header: CQ-Action:Activate

2019-02-01 20:03:38 - DEBUG - flush : adding header: CQ-Handle:/content/we-retail/us/en/products/men/coats/portland-hooded-jacket

2019-02-01 20:03:38 - DEBUG - flush : adding header: CQ-Path:/content/we-retail/us/en/products/men/coats/portland-hooded-jacket

2019-02-01 20:03:38 - DEBUG - flush : adding header: CQ-Action-Scope:ResourceOnly

2019-02-01 20:03:38 - DEBUG - flush : deserialize content for delivery

2019-02-01 20:03:38 - DEBUG - flush : No message body: Content ReplicationContent.VOID is empty

2019-02-01 20:03:38 - INFO - flush : Sending GET request to http://localhost:80/dispatcher/invalidate.cache

2019-02-01 20:03:38 - INFO - flush : sent. Response: 200 OK

2019-02-01 20:03:38 - INFO - flush : ------------------------------------------------

2019-02-01 20:03:38 - INFO - flush : Sending message to localhost:80

2019-02-01 20:03:38 - INFO - flush : >> GET /dispatcher/invalidate.cache HTTP/1.0

2019-02-01 20:03:38 - INFO - flush : >> CQ-Action: Activate

2019-02-01 20:03:38 - INFO - flush : >> CQ-Handle: /content/we-retail/us/en/products/men/coats/portland-hooded-jacket

2019-02-01 20:03:38 - INFO - flush : >> CQ-Path: /content/we-retail/us/en/products/men/coats/portland-hooded-jacket

2019-02-01 20:03:38 - INFO - flush : >> CQ-Action-Scope: ResourceOnly

2019-02-01 20:03:38 - INFO - flush : >> Referer: about:blank

2019-02-01 20:03:38 - INFO - flush : >> Content-Length: 0

2019-02-01 20:03:38 - INFO - flush : >> Content-Type: application/octet-stream

2019-02-01 20:03:38 - INFO - flush : --

2019-02-01 20:03:38 - INFO - flush : << HTTP/1.1 200 OK

2019-02-01 20:03:38 - INFO - flush : << Date: Sat, 02 Feb 2019 01:03:38 GMT

2019-02-01 20:03:38 - INFO - flush : << Server: Apache

2019-02-01 20:03:38 - INFO - flush : << Content-Length: 13

2019-02-01 20:03:38 - INFO - flush : << Content-Type: text/html; charset=utf-8

2019-02-01 20:03:38 - INFO - flush : <<

2019-02-01 20:03:38 - INFO - flush : <<

2019-02-01 20:03:38 - INFO - flush : Message sent.

2019-02-01 20:03:38 - INFO - flush : ------------------------------------------------

2019-02-01 20:03:38 - INFO - flush : Replication (ACTIVATE) of /content/we-retail/us/en/products/men/coats/portland-hooded-jacket successful.

Dispatcher logs without ResourceOnly header

[D] [pid 26952 (tid 1152)] Found farm website for localhost

[D] [pid 26952 (tid 1152)] checking [/dispatcher/invalidate.cache]

[I] [pid 26952 (tid 1152)] Activation detected: action=Activate [/content/we-retail/us/en/products/men/coats/portland-hooded-jacket]

[I] [pid 26952 (tid 1152)] Touched c:\installed_setups\Apache2.2\htdocs\.stat

[I] [pid 26952 (tid 1152)] Touched c:\installed_setups\Apache2.2\htdocs\content\.stat

[I] [pid 26952 (tid 1152)] Touched c:\installed_setups\Apache2.2\htdocs\content\we-retail\.stat

[I] [pid 26952 (tid 1152)] Touched c:\installed_setups\Apache2.2\htdocs\content\we-retail\us\.stat

[D] [pid 26952 (tid 1152)] response.status = 200

[D] [pid 26952 (tid 1152)] response.headers[Server] = "Communique/2.6.3 (build 5221)"

[D] [pid 26952 (tid 1152)] response.headers[Content-Type] = "text/html"

[D] [pid 26952 (tid 1152)] cache flushed

[I] [pid 26952 (tid 1152)] "GET /dispatcher/invalidate.cache" 200 13 26ms [website/-]

and

2019-02-01 20:04:28 - INFO - flush : Agent started.

2019-02-01 20:04:36 - INFO - flush : Creating content for path /content/we-retail/us/en/products/men/coats/portland-hooded-jacket

2019-02-01 20:04:36 - INFO - flush : Create new HttpClient for Dispatcher Flush

2019-02-01 20:04:36 - INFO - flush : * HTTP Version: 1.1

2019-02-01 20:04:36 - DEBUG - flush : adding header: CQ-Action:Activate

2019-02-01 20:04:36 - DEBUG - flush : adding header: CQ-Handle:/content/we-retail/us/en/products/men/coats/portland-hooded-jacket

2019-02-01 20:04:36 - DEBUG - flush : adding header: CQ-Path:/content/we-retail/us/en/products/men/coats/portland-hooded-jacket

2019-02-01 20:04:36 - DEBUG - flush : deserialize content for delivery

2019-02-01 20:04:36 - DEBUG - flush : No message body: Content ReplicationContent.VOID is empty

2019-02-01 20:04:36 - INFO - flush : Sending GET request to http://localhost:80/dispatcher/invalidate.cache

2019-02-01 20:04:37 - INFO - flush : sent. Response: 200 OK

2019-02-01 20:04:37 - INFO - flush : ------------------------------------------------

2019-02-01 20:04:37 - INFO - flush : Sending message to localhost:80

2019-02-01 20:04:37 - INFO - flush : >> GET /dispatcher/invalidate.cache HTTP/1.0

2019-02-01 20:04:37 - INFO - flush : >> CQ-Action: Activate

2019-02-01 20:04:37 - INFO - flush : >> CQ-Handle: /content/we-retail/us/en/products/men/coats/portland-hooded-jacket

2019-02-01 20:04:37 - INFO - flush : >> CQ-Path: /content/we-retail/us/en/products/men/coats/portland-hooded-jacket

2019-02-01 20:04:37 - INFO - flush : >> Referer: about:blank

2019-02-01 20:04:37 - INFO - flush : >> Content-Length: 0

2019-02-01 20:04:37 - INFO - flush : >> Content-Type: application/octet-stream

2019-02-01 20:04:37 - INFO - flush : --

2019-02-01 20:04:37 - INFO - flush : << HTTP/1.1 200 OK

2019-02-01 20:04:37 - INFO - flush : << Date: Sat, 02 Feb 2019 01:04:37 GMT

2019-02-01 20:04:37 - INFO - flush : << Server: Apache

2019-02-01 20:04:37 - INFO - flush : << Content-Length: 13

2019-02-01 20:04:37 - INFO - flush : << Content-Type: text/html; charset=utf-8

2019-02-01 20:04:37 - INFO - flush : <<

2019-02-01 20:04:37 - INFO - flush : <<

2019-02-01 20:04:37 - INFO - flush : Message sent.

2019-02-01 20:04:37 - INFO - flush : ------------------------------------------------

2019-02-01 20:04:37 - INFO - flush : Replication (ACTIVATE) of /content/we-retail/us/en/products/men/coats/portland-hooded-jacket successful.