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

SOLVED

Create cache for /etc/cloudsettings.kernel.js file

paulojorgemtava
Level 2
Level 2

Hi Team,

 

How do I cache the /etc/cloudsettings.kernel.js file in the dispatcher?

 

Regards

cache contexthub Dispatcher
1 Accepted Solution
paulojorgemtava
Correct answer by
Level 2
Level 2

Hi @del27634,

 

below the screenshots:

 

policy1.png

policy3.png

policy4.png

 

policy2.png

 

 

 

View solution in original post

18 Replies
asutosh_jena
Community Advisor
Community Advisor

Hi @paulojorgemtava 

You can add the below highlighted rule in your farms any file under rules section and it will cache the file.

 

/rules
{
/0000 { /glob "*" /type "deny" }
/0001 { /glob "/etc/cloudsettings.kernel.js" /type "allow" }
}

 

Please refer the rules section here priovided by Adobe:

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

 

Hope this helps!
Thanks!

paulojorgemtava
Level 2
Level 2
The path complete is /etc/cloudsettings.kernel.js/conf/.../settings/cloudsettings/.../contexthub, I added this rule, but It isn't work the cache.
asutosh_jena
Community Advisor
Community Advisor

@paulojorgemtava 
Could you please provide the complete file path with file extension?

paulojorgemtava
Level 2
Level 2
The path complete is https://host/etc/cloudsettings.kernel.js/conf/jca/settings/cloudsettings/jca/contexthub
asutosh_jena
Community Advisor
Community Advisor

@paulojorgemtava 
This file will not be cached in dispatcher.

Dispatcher does not cache a file when there is no extension.

Thanks!

paulojorgemtava
Level 2
Level 2
The file have extension, but concatenate with other path https://host/etc/cloudsettings.kernel.js + /conf/jca/settings/cloudsettings/jca/contexthub.
asutosh_jena
Community Advisor
Community Advisor

@paulojorgemtava 

If you see the below examples:

http://localhost:4502/etc/cloudsettings.kernel.js/libs/settings/cloudsettings/legacy/contexthub - This is the file which will deliver the content which does not have any extension which will not be cached.
http://localhost:4502/etc/cloudsettings.kernel.js - This has an extension but it does not deliver any content.

 

There is another way to cache the file by applying a rewrite rule but for that the incoming URL needs to be updated and should have an extension which I am not sure if it will be possible in your case as you might not be able to change the incoming URL such as:

Request URL: http://localhost:4502/etc/cloudsettings.kernel.js/something.js -> Rewrite to http://localhost:4502/etc/cloudsettings.kernel.js/libs/settings/cloudsettings/legacy/contexthub

which will serve the content as well as cache the content with something.js name.

 

Thanks!

paulojorgemtava
Level 2
Level 2
I will create a rule on RewriteRule and back here with the feedback . Thanks
del27634
Level 1
Level 1
I too am facing similar issue, when this files tried to load it take way more (~2-3 sec) more to load compared to AEM 6.4 version. @paulojorgemtava was this issue resolved for you?
paulojorgemtava
Level 2
Level 2
@del27634 I created only the "rep:policy" bellow the folder /conf/.../settings/cloudsettings/.../contexthub.
del27634
Level 1
Level 1

Hi @paulojorgemtava,
Has that resolved the cache issue? I see the publisher takes long time to return the response every time the request is made.
Could you please post the resolution you tried for this?

paulojorgemtava
Level 2
Level 2
@del27634, Has that not resolved the cache issue, because this file not create cache, but this permission resolved the problem with long request.
del27634
Level 1
Level 1

Hello @paulojorgemtava,
 That is exactly what i am seeing, the long response time from the publish server.
Could you please let me know in the rep:policy node what was the content added, was the user added was "everyone"?
If possible can you provide a screen-shot, that would be really very helpful.

paulojorgemtava
Correct answer by
Level 2
Level 2

Hi @del27634,

 

below the screenshots:

 

policy1.png

policy3.png

policy4.png

 

policy2.png

 

 

 

View solution in original post

kautuk_sahni
Community Manager
Community Manager
Thank you for sharing this with AEM Community. Good to have AEM SMEs like you in this community. Looking forward to see to more.