Expand my Community achievements bar.

SOLVED

curl invalidate cache requireing full filesystem path

Avatar

Level 2

Hi, 

 

I have been working on performing a cache flush via curl. When I run it against the /content path, the dispatcher log shows that it tried (and failed due to lack of permission) to create /.stat  

the "/" it is referring to is root on the filesystem.

 

I verified this by passing the curl command the full filesystem path and it clears the cache as expected (removing the content directory as well.

 

Have I configured something wrong? Is there some specific setting to change? 

 

All the examples i have seen show cache flush paths being relative to document root.

 

Thanks!
 

Matt

1 Accepted Solution

Avatar

Correct answer by
Level 10

See these examples:

http://blogs.adobe.com/contentmanagement/2013/08/20/how-to-send-aem-dispatcher-flush-request-via-cur...

See this older community thread:

https://forums.adobe.com/thread/1128519

in your description - you stated that you did clear cache:

 passing the curl command the full filesystem path and it clears the cache as expected

So why not clear cache using the file system path?

View solution in original post

5 Replies

Avatar

Correct answer by
Level 10

See these examples:

http://blogs.adobe.com/contentmanagement/2013/08/20/how-to-send-aem-dispatcher-flush-request-via-cur...

See this older community thread:

https://forums.adobe.com/thread/1128519

in your description - you stated that you did clear cache:

 passing the curl command the full filesystem path and it clears the cache as expected

So why not clear cache using the file system path?

Avatar

Level 5

Hello Matt,

When you clear cache with Curl or through activation, at apache layer there should be a domain mapped to your request through Vhost. VHost should have a Document root for which apache should have access. I think in your case proper virtual host with document root is not set.

Yogesh

Avatar

Level 2

smacdonald2008 - I end up removing the docroot directory if i choose to remove at the docroot level.  I tried using a * at the end of the path, to avoid removing the docroot dir, but it didn't work.  Without a docroot, i'm dead. no caching, only 404.

 

Yogesh - I am using an environment variable within apache and dispatcher for docroot.  I am also using the and environment variable for the  FQDN of the virtualhost in both httpd.conf and dispatcher.any.  I know from the fact that i am caching successfully, and that the logs (which have the domain variable value in their name) are created and written to properly that the variables are working within httpd.conf.  

 

I am using Mod_macro for the virtualhost definition:

 

<Macro VHost $host $port $dir>
  <VirtualHost *:$port>

    ServerAdmin webadmin@enterprise.com
    ServerName $host
    DocumentRoot $dir
    ErrorLog /opt/aem/dispatcher/logs/$host-error_log
    CustomLog /opt/aem/dispatcher/logs/$host-access_log common
    <Directory "$dir">
      Options FollowSymLinks ExecCgi Includes
      AllowOverride None
      Order allow,deny
      Allow from all
      SetHandler dispatcher-handler
    </Directory>

</Virtualhost>

I call the macro like:

 Use VHost ${DOMAIN_NAME} 4500 ${DOCROOT}
 

 

Where DOMAIN_NAME is the FQDN of the virtualhost.

4500 is the port that the virtualhost listens on

DOCROOT is the filesystem path to the apache cache.

 

As I said, these elements all work within httpd.conf and it caches successfully.

 /virtualhosts
      {
      # Entries will be compared against the "Host" request header
      # and an optional request URL prefix.
      #
      # Examples:
      #
      #   www.company.com
      #   intranet.*
      #   myhost:8888/mysite
      "${DOMAIN_NAME}"
      }

EDIT: I forgot to include the DOCROOT section of dispatcher.any

     /docroot "${DOCROOT}"

 

 

 

Also, can I get one clarification?  Will invalidate.cache always work with full filesystem path?

Avatar

Level 5

What message do you see when you enable debug mode for your dispatcher ? For every dispatcher flush request, log should show you what Vhost it has selected to serve dispatcher flush request. If it is same Vhost as your dispatcher Vhost, then make sure that docroot is set to correct value in dispatcher.any. If this is also set correctly, then may be engage some one from adobe through daycare to debug your issue.

Yogesh

Avatar

Level 2

By default invalidate.cache will work with the full repository content path.

You can add this to your logging in Apache

# define a LogFormat to use for dispatcher flush requests, include the CQ-Action, CQ-Handle and CQ-Path CQ-Action-Scope parameters, see: http://docs.adobe.com/docs/en/dispatcher/page-invalidate.html LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %D %v %p %{local}p %R \"%{CQ-Action}i\" \"%{CQ-Handle}i\" \"%{CQ-Path}i\" \"%{CQ-Action-Scope}i\"" dispatcher

 

If you just want a clean slate after a deployment, either delete everything in the dispatcher folder or simply touch all the stat files, like so:

find /path/to/dispatcher/cache/root/ -maxdepth 6 -type f -name ".stat" -exec touch  {} \;