CKEditor resources caching issue

We’re currently facing an issue with CKEditor resources caching, specifically related to our custom CKEditor resources. The problem at hand is that new CSS resources are not being downloaded by the browser due to aggressive caching.

The documentation suggests that you can control CKEditor resources caching: CKEditor caching - Bloomreach Experience Manager.

Unfortunately, it doesn’t function as described, as explained below.

Setting cacheTimeout in web.xml:
According to the documentation, adjusting the cacheTimeout parameter in cms/src/main/webapp/WEB-INF/web.xml via the ResourceServlet should control caching. The default value is 0, indicating no caching. However, our investigation reveals that this setting doesn’t seem to work as intended. A closer look at the source code of org.onehippo.cms7.utilities.servlet.ResourceServlet suggests that the cachingTimeout parameter is ignored entirely, and the Cache-Control response header is always set to max-age=31556926 (a year).

Timestamp automattically appended to requests
The documentation also mentions that each request to a CKEditor resource receives a timestamp (CKEDITOR.timestamp) automatically appended to the request. This timestamp supposedly gets regenerated with each restart of brXM. However, it appears that this mechanism doesn’t fully function, because CSS resources don’t receive a timestamp appended to the request. As a result, the browser keeps using old CSS files and doesn’t download the new ones.

Has anyone else in the community encountered a similar issue or managed to find a viable fix or workaround?

(We’re running brXM 15.4.0)

Hi,
The usage of ‘cacheTimeout’ init parameter for the ResourceServlet was removed a long time ago per CMS-10350, the documentation never got updated… that will be fixed soon, thanks for reporting.

Regarding CKEDITOR.timestamp, this is still in place, seem to be statically calculated based on the a hash of the application (combined jar files), with a fallback to timestamp. Code in
org.hippoecm.frontend.util.WebApplicationHelper#calculateApplicationHash. Maybe it doesn’t change on restart but it does on upgrade (different jars).

HTH
Jeroen