Expand my Community achievements bar.

SOLVED

Cache non AEM pages in dispatcher

Avatar

Level 1

Hi all,

 

We are working on a use case where we must cache a proxy request. For example, we have a path /us/en/load (sample path) where we pass through this request from the dispatcher to a third-party back-end server (which is not AEM).

 

RewriteRule /us/en/load https://third-party-server/us/en/load [PT, NC, L]

 

We also have multiple paths like these so that any leads would be greatly appreciated.

 

The subsequent resources of the page(s), like images, CSS, and JS everything, come with a folder like /_identifier/static/front-end.css so we need to cache this /_identifier/static folder too in the dispatcher.

 

 

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@nkoppul1 

 

Please try using LocationMatch to cache third-party content

<LocationMatch "/flights.json">
    RewriteEngine on
    ProxyPass "${HOST1}flights.json"
    RequestHeader set X-System-ID DEV_AEM
    RequestHeader set X-Application-Key "${DEV_AEM_APPLICATION_KEY}"
    ProxyPassReverse "${HOST1}flights.json"
</LocationMatch>

https://techrevel.blog/2024/06/09/aem-reverse-proxy/ 


Aanchal Sikka

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

@nkoppul1 

 

Please try using LocationMatch to cache third-party content

<LocationMatch "/flights.json">
    RewriteEngine on
    ProxyPass "${HOST1}flights.json"
    RequestHeader set X-System-ID DEV_AEM
    RequestHeader set X-Application-Key "${DEV_AEM_APPLICATION_KEY}"
    ProxyPassReverse "${HOST1}flights.json"
</LocationMatch>

https://techrevel.blog/2024/06/09/aem-reverse-proxy/ 


Aanchal Sikka