[Dispatcher] .stat file not generated | Community
Skip to main content
Level 2
October 1, 2018
Solved

[Dispatcher] .stat file not generated

  • October 1, 2018
  • 11 replies
  • 9708 views

Hi,

I'm configuring dispatcher to generate the .stat file from the config:

/cache

{

  # the cacheroot must be equal to the document root of the webserver

  /docroot "/mnt/cache"

  # sets the level upto which files named ".stat" will be created in the

  # document root of the webserver. when an activation request for some

  # handle is received, only files within the same subtree are affected

  # by the invalidation.

  /statfileslevel "1"

}

By right, the stat file should be auto-generated at docroot (/mnt/cache) when I restart apache, but there was no file generated (I check with command ls -la).

From the log when I access the dispatcher:

[Thu Sep 27 10:43:05 2018] [D] [pid 19238] Found farm publishfarm for dispatcher

[Thu Sep 27 10:43:05 2018] [D] [pid 19238] checking [/content/mywebsite/en.html]

[Thu Sep 27 10:43:05 2018] [D] [pid 19238] never flushed [/mnt/cache/content/mywebsite/.stat] -> use cache [/mnt/cache/content/mywebsite/en.html]

[Thu Sep 27 10:43:05 2018] [D] [pid 19238] cache-action for [/content/mywebsite/en.html]: DELIVER

[Thu Sep 27 10:43:05 2018] [D] [pid 19238] request declined

[Thu Sep 27 10:43:05 2018] [I] [pid 19238] "GET /content/mywebsite/en.html" - - 0ms

Please advise me on this. Any help would be appreciated.

My dispatcher version is 4.2.2 for Apache 2.4 on Linux 64 bit.

Thanks.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by aneetarora

Hello Manh,

The behavior you're seeing is expected. It's because you've added the statefileslevel with a value of "1".

The value of "1" means that there will be two .stat files, one at the docroot itself, and another one at docroot and one at the /content directory. So you should see a .stat file in the /mnt/cache and at /mnt/cache/content directories.

If you wish to see a .stat file generated for every single one of your content levels, you'll have to change the statfileslevel to "6", or "7" or to the depth of your site structure and then replicate a page. For example, if you wish to see the .stat file at /content/mywebsite/test1/test2/test3/test4, you'll have to set the statfileslevel to "7", restart the dispatcher and replicate the page to see the .stat file.

For further information about this stat file's usage and it's implications, please check Configuring Dispatcher

Best Regards,

Aneet Arora

11 replies

Peter_Puzanovs
Community Advisor
Community Advisor
October 1, 2018

Dear Manh,

Looking at your log. The request is actually being served from Cache.

Kindly look at /mnt/cache/content/mywebsite and check for .stat file there.

Regards,

Peter

Lokesh_Shivalingaiah
Level 10
October 1, 2018

as your statfilelevel is set to 1, it should be under /content/mywebsite

Level 2
October 2, 2018

Hi guys,

Thanks for replying.

I checked at the path /mnt/cache/content/mywebsite with command "ls -la", but I see no stat file created (I'm logged as root).

Adobe Employee
October 2, 2018

You need to configure a flush agent (Invalidating Cached Pages From AEM ) and replicate at least once. Then check /mnt/cache/content/mywebsite for a .stat file

aneetaroraAdobe EmployeeAccepted solution
Adobe Employee
October 2, 2018

Hello Manh,

The behavior you're seeing is expected. It's because you've added the statefileslevel with a value of "1".

The value of "1" means that there will be two .stat files, one at the docroot itself, and another one at docroot and one at the /content directory. So you should see a .stat file in the /mnt/cache and at /mnt/cache/content directories.

If you wish to see a .stat file generated for every single one of your content levels, you'll have to change the statfileslevel to "6", or "7" or to the depth of your site structure and then replicate a page. For example, if you wish to see the .stat file at /content/mywebsite/test1/test2/test3/test4, you'll have to set the statfileslevel to "7", restart the dispatcher and replicate the page to see the .stat file.

For further information about this stat file's usage and it's implications, please check Configuring Dispatcher

Best Regards,

Aneet Arora

smacdonald2008
Level 10
October 2, 2018

Great response Aneet!

raj_mandalapu
Level 7
October 2, 2018

I think there is a miss communication out here, the stat file is not appearing for him, according to the theory, it should appear and he is asking why it is not appearing. correct me if I am wrong

Adobe Employee
October 2, 2018

rajas66269496

That's my understanding as well. And my response addresses that with some more details.

To answer your question, it is not the right expectation that .stat file will be generated in all the directories in the cache. So I answered the question stating "why is it not appearing" because the "statfileslevel" is set to "1", which means .stat files will only be generated at docroot and one level below docroot, that's it.

Please test this out on your end as well for confirmation.

Level 2
October 3, 2018

Hi guys,

Thanks for sharing your thought.

I found the issue, that the dispatcher flush agent is set the HTTP headers to "CQ-Action-Scope: ResourceOnly". I removed it then do a replicate, the .stat files are generated.

From my understand, it's used for the dispatcher flush rules inside ResourceOnly. Can I know if I remove this from dispatcher flush agent is ok? I still have some dispatcher flush rules inside ResourceOnly (in OSGi config).

Regards,

Manh

raj_mandalapu
Level 7
October 3, 2018

Generally we use this "CQ-Action-Scope: ResourceOnly" if you want to invalidate particular resources without touching stat file on daily basis, example: external feeds, JSON responses etc... please check if you have any requirement on this before deleting