Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
joerghoh
joerghohAccepted solution
Adobe Employee
September 9, 2022

There are 3 rules which are backed into the dispatcher regarding caching:

  1. Only the response of GET requests are cached.
  2. The requested file must have an extension
  3. The statuscode of the request must be 200.

And then there are other options you can configure, for example regarding paths, extensions etc.

 

Also the HTTP RFCs mention that only GET should be cached, because POST requests are designed to change status, and therefor caching their result and returning them on a different POST request will return inconsistent data.

 

If course you can build your own code into AEM to cache POST requests (or part of it), but by default neither AEM nor the Dispatcher support that. And in case of AEM as a Cloud Service also the CDN does not support it.

4 replies

arunpatidar
Community Advisor
Community Advisor
September 8, 2022

Dispatcher does not cache post request.

Please check https://experienceleague.adobe.com/docs/experience-cloud-kcs/kbarticles/KA-17497.html?lang=en 

Translate
Arun Patidar
AnikaAgAdobe EmployeeAuthor
Adobe Employee
September 8, 2022

Thanks @arunpatidar . Is there an alternative way so that POST response can be cached?

 

Thanks

Anika

Translate
arunpatidar
Community Advisor
Community Advisor
September 8, 2022

Hi,

You can cached directly in AEM at /var location and provided directly or use in memory caching.

https://adobe-consulting-services.github.io/acs-aem-commons/features/http-cache/index.html 

Translate
Arun Patidar
joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
September 9, 2022

There are 3 rules which are backed into the dispatcher regarding caching:

  1. Only the response of GET requests are cached.
  2. The requested file must have an extension
  3. The statuscode of the request must be 200.

And then there are other options you can configure, for example regarding paths, extensions etc.

 

Also the HTTP RFCs mention that only GET should be cached, because POST requests are designed to change status, and therefor caching their result and returning them on a different POST request will return inconsistent data.

 

If course you can build your own code into AEM to cache POST requests (or part of it), but by default neither AEM nor the Dispatcher support that. And in case of AEM as a Cloud Service also the CDN does not support it.

Translate