Short hand urls not getting flushed or invalidated from server | Community
Skip to main content
sgarg122001
Level 2
Feb 16, 2019 6:43 PM UTC
Solved

Short hand urls not getting flushed or invalidated from server

I am using AEM 6.3.1.0. To achieve URL shortening I used Apache Sling resource resolver factory and it works fine. Now at apache, the cache is persisted with shortened paths as /en/home.html, /en/home/page1.html etc.

This disturbs flush agents as when /content/myapp/en/home is published, corresponding path is not found in apache and no flushing happens. This makes /en/home.html obsolete.

One solution i got to fix this issue is apache rewrite rules in httpd.conf file. If i add the rewrite rules so i dont need to add the rewrite rules in Apache Sling resource resolver factory am i right? Or do we have any other way to fix this issue other than apache rewrite rules.

Thanks in advance.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Gaurav-Behl
Gaurav-BehlAccepted solution
Level 10
Feb 17, 2019 5:09 PM UTC

Couple of options:

  • Write a custom flush agent to do what 'ACS Dispatcher Flush Rules' does. In fact, you could reuse the source code per your requirements. The approach is to manipulate the flush path to achieve what you want to do
  • There is a flag in replication/flush agents as 'Alias Update'. When it is turned on, it flushes the vanity urls configured in page properties as sling:vanity. I'm not sure if it would work with resource resolver but you can try or borrow this feature.
  • Custom rewrite rules in apache that you already tried/tested.

       

3 replies

Gaurav-Behl
Gaurav-BehlAccepted solution
Level 10
Feb 17, 2019 5:09 PM UTC

Couple of options:

  • Write a custom flush agent to do what 'ACS Dispatcher Flush Rules' does. In fact, you could reuse the source code per your requirements. The approach is to manipulate the flush path to achieve what you want to do
  • There is a flag in replication/flush agents as 'Alias Update'. When it is turned on, it flushes the vanity urls configured in page properties as sling:vanity. I'm not sure if it would work with resource resolver but you can try or borrow this feature.
  • Custom rewrite rules in apache that you already tried/tested.

       

Translate
sgarg122001
Level 2
Feb 17, 2019 2:25 PM UTC

Hi Gaurav,

We are not using ACS common package in our project is there any thing else that we can do to clear the cache for short urls.

Translate
Gaurav-Behl
Level 10
Feb 17, 2019 12:29 PM UTC

Use ACS Dispatcher Flush Rules to flush /content/myapp/en*=/en*   or /content/myapp/.*=/.*

Create rules per your requirements

Translate