Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Feb 29, 2024 7:49:29 AM
Jan 4, 2023 10:25:19 AM
With content cache-controls, you can modify the cache behavior of the browser. The cache-control is used on endpoints handled by the repository service. This functionality is disabled by default and can be enabled by modifying the files Repository.exe.conf and capabilities.json, followed by a restart of the Qlik Sense Service Dispatcher and the Qlik Sense Repository Service.
Cache-control for endpoints handled by the repository service was introduced in Qlik Sense Enterprise on Windows February 2022 (Patch 1). In the May 2022 release further enhancements were made to extend caching policies for requests specific to the Hub service. Upgrade Qlik Sense to make use of the new features.
In this article, we walk you through modifying the cache control policy and how to apply it globally across your Qlik Sense Enterprise on Windows environment.
Please note the following before modifying cache control headers:
Prior to applying any changes in a production environment, evaluate the risks of the changes.
The feature is disabled by default. For details, see Configuring content cache-control.
A second restart of the Qlik Sense Dispatcher Service is required to propagate the cache control settings correctly.
A second restart of the Qlik Sense Dispatcher Service is required to propagate the cache control settings correctly.
These are the predefined cache-control header values:
"CachePolicyEnum": { "values": [ "0: Normal", -> public, max-age=3600 "1: MustRevalidate", -> public, must-revalidate, max-age=0 "2: PrivateNormal", -> private, max-age=3600 "3: PrivateMustRevalidate", -> private, must-revalidate, max-age=0 "4: NoStore" -> no-store ] }
You can create a global cache control policy (not tied to a content library) by using either the API or an SQL query against the QRS database. A restart of the Qlik Sense Service Dispatcher and Qlik Sense Repository service is required after.
API example:
POST /qrs/ContentCacheControl
{ "id": "e07ca071-7d72-417d-93c2-d60687f747a8", "name": "api", "contentLibrary": null, "filter": "api", "maxAge": 3600, "cachePolicy": 4, "privileges": null }
INSERT INTO public."ContentCacheControls" ("ID", "CreatedDate", "ModifiedDate", "ModifiedByUserName", "Name", "Filter", "MaxAge", "CachePolicy", "ContentLibrary_ID") VALUES ('e07ca071-7d72-417d-93c2-d60687f747a8', '2022-08-19 14:28:48.077709', '2022-08-19 14:28:48.077709', 'RDLUND\svc-silver', 'api', 'api', 3600, 4, null);
The information in this article is provided as-is and to be used at own discretion. Depending on tool(s) used, customization(s), and/or other factors ongoing support on the solution below may not be provided by Qlik Support.
What's new in Qlik Sense February 2022
What's new in Qlik Sense May 2022
Qlik Sense Enterprise on Windows
QB-11410
Thanks. Great post!
I see that there are only 4 policies, but I need to create a global Cache-Control with the following information:
Cache-Control: no-store, no-cache, max-age=0
Is there a way to create it?
Thanks!
Hello @jpbartolomeo1
I have not been able to verify if this is possible. But before I send you over to create an idea (which may be necessary), let me check with our product team and get back to you.
All the best,
Sonja
Hello @jpbartolomeo1
As a follow-up. Using policy 4 (no store) will serve the purpose you are going for with no-store, no-cache, max-age=0 without needing no-cache and max-age=0 as it will simply use no-store to achieve both.
To explain:
max-age=0 forces the response to be validated again. It is also a legacy setting meant for implementations which do not support no-cache.
no-cache forces the response to be validated again, but if you are aiming to prevent the cache from storing responses entirely, no-store is recommended.
All the best,
Sonja
Thanks for your answer, Sonja!
I will use the no-store then.
I have to change all the cache policies for Qlik (hub, qmc, api), so I used the filter (.*?). This was a requirement from the client's Security team.
The PoC is working great: I receive the correct header in the HTTP response.
I have to do a document explaining before they do it explaining also the impact.
I know this only disables the browser cache to avoid confidential data storage.
Is there any possible problem we can have with the clients connecting to Qlik? Any negative impact that can result for this change? I can't find more info.
Thanks!
Hello @jpbartolomeo1
The impact would be the same as for any other platform where caching is disabled: every access will lead to the content being reloaded (newly requested). No other impact unique to Qlik is known. This does not apply to our in-memory engine. It will not affect the performance of the app's calculations and fetching of selections.
All the best,
Sonja
Thanks! 🙂