How to use the "long cache" feature in HTML Library Manager? | Community
Skip to main content
Level 2
September 18, 2020
Question

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

  • September 18, 2020
  • 1 reply
  • 3564 views

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-manager/qaq-p/326483

https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/adobe-granite-html-library-manager-long-term-client-side-cache/qaq-p/292512

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Singaiah_Chintalapudi
Level 7
September 18, 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

Level 2
September 18, 2020
Yes, I get that, but in order to have far-future expires headers in Apache or the CDN I need to have a version string or hash of some sort on the clientlib include.