Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Assets HTTP API pagination and dispatcher caching

Avatar

Avatar
Validate 1
Level 1
mpalme1
Level 1

Likes

2 likes

Total Posts

37 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
mpalme1
Level 1

Likes

2 likes

Total Posts

37 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
mpalme1
Level 1

18-12-2020

I am working on a component that loads content fragment data with javascript and a request to the assets HTTP API. I need a full result set but the response is paginated as described here:

https://experienceleague.adobe.com/docs/experience-manager-65/assets/extending/assets-api-content-fr...
If I passed ?limit=150, I would get all my results, but then the dispatcher won't cache the response without me setting a global ignoreUrlParams configuration as described here:

https://experienceleague.adobe.com/docs/experience-manager-dispatcher/using/configuring/dispatcher-c...

I need a more precise (not global) way to solve this that doesn't prevent dispatcher caching. I've considered writing a custom servlet to return the data, but if there's better, more out-of-the-box approach to this, I'd prefer it.

Suggestions?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 10
MVP
kunal23
MVP

Likes

166 likes

Total Posts

565 posts

Correct Reply

172 solutions
Top badges earned
Validate 10
Validate 1
Ignite 3
Ignite 1
Give Back 50
View profile

Avatar
Validate 10
MVP
kunal23
MVP

Likes

166 likes

Total Posts

565 posts

Correct Reply

172 solutions
Top badges earned
Validate 10
Validate 1
Ignite 3
Ignite 1
Give Back 50
View profile
kunal23
MVP

18-12-2020

Another option is to rewrite the API url on the live page JS code so that it passes the page size as a selector in the URL. Like - /api/assets/cf.150.json. And then you can add a rewrite rule in Apache to remove the selector and add it as a query param before it passes the URL to AEM for processing. However, on AEM author instance you will have to to use regular query param based URL only. 

Answers (0)