How to use the "long cache" feature in HTML Library Manager?

Avatar

Avatar
Level 1
paulr19803740
Level 1

Likes

0 likes

Total Posts

5 posts

Correct reply

0 solutions
View profile

Avatar
Level 1
paulr19803740
Level 1

Likes

0 likes

Total Posts

5 posts

Correct reply

0 solutions
View profile
paulr19803740
Level 1

18-09-2020

There is a "long cache" feature in the com.adobe.granite.ui.clientlibs.impl.HtmlLibraryManagerImpl which apparently has similar functionality to ACS Commons Versioned Clientlibs. However, I can't find any documentation on how it's supposed to work.

 

I've tried this out locally and when I set the "htmllibmanager.longcache.patterns" to "/.*;auto" it generates the clientlib include with a version string like so: /etc.clientlibs/company-name/clientlibs/clientlib-all.lc-1600281673684-lc.css

(note that I also needed to manually click "Invalidate Caches" in http://localhost:4503/libs/granite/ui/content/dumplibs.rebuild.html before this took effect).

 

However, since the cache key is set to "auto", it is automatically generated when this service restarts. In my mind that defeats the purpose since I don't want to restart the service every time I make an update to the CSS or JS in the clientlib. What am I missing? How is this feature supposed to be used so that it really mimics what ACS Commons Versioned Clientlibs is doing?

 

I saw a few people with the same question but no satisfactory answer yet:

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/adobe-granite-html-library...

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/adobe-granite-html-library...

 

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar
Validate 25
MVP
Singaiah_Chintalapudi
MVP

Likes

131 likes

Total Posts

234 posts

Correct reply

39 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile

Avatar
Validate 25
MVP
Singaiah_Chintalapudi
MVP

Likes

131 likes

Total Posts

234 posts

Correct reply

39 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Ignite 5
Ignite 3
View profile
Singaiah_Chintalapudi
MVP

18-09-2020

This looks like its related to client-side/browser caching. If you're looking for browser side caching, I would strongly recommend to use either Apache or CDN (this is recommended for easier maintenance) to pass the expiration headers for your client libraries.

 

If you can manage these configurations at Apache/CDN then you have more control over the expiration headers for other files i.e. images, documents as well.

 

Let me know whats your requirement?

 

Thanks,

Singaiah