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

AEM 6.2 Caching

Avatar

Avatar
Validate 1
Level 1
matriccinod
Level 1

Like

1 like

Total Posts

9 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
matriccinod
Level 1

Like

1 like

Total Posts

9 posts

Correct Reply

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

07-07-2017

Hi all,

I have a component that has to render different depending on the end-user's geolocation (specifically, which country they are in). The component works correctly, when bypassing cache, however, if the first request to the page is a user from Canada (which should be rendered differently than other countries), and the second request comes in by an end-user from United States, the dispatcher will serve the version from Canada. I can see the cached HTML file in the dispatcher server, and understand it's directly serving this HTML file. Is there a way to disable cache for a specific page if a component is used? Or even better, is there a way to dynamically load the component per request?

Another interesting piece of info, is that the above form redirects to a page called payment-redirection.html, which has a custom component called paymentredirection on it. Now when this page is accessed, the caching structure is different than above. Instead of a direct "payment-redirection.html" file, there's a folder structure created: payment-redirection/jcr:content. In this directory are two files "contexthub.commerce.relatedproducts.json  contexthub.pagedata.json".

Both components are structured the same way, for the most part. Both are using Slightly, and the resource classes being used for both are using the @Model(adaptables = { SlingHttpServletRequest.class, Resource.class }) methodology.

Is it possible to render the first page and have it cache the page the same way as the "payment-redirection.html" page is being cached?

Thanks,

Danny

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 8
MC_Stuff
Level 8

Likes

78 likes

Total Posts

467 posts

Correct Reply

158 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 1
Level 8
MC_Stuff
Level 8

Likes

78 likes

Total Posts

467 posts

Correct Reply

158 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile
MC_Stuff
Level 8

11-07-2017

Hi Danny,

The part which are dynamic make use of ajax OR SSI. More details at Dispatcher Caching - New Features and Optimizations 

For payment redirection make use of selector.

Thanks,

Answers (0)