Leverage Django Cache for caching policy check result
Summary:
Leverage Django Cache Framework instead of dumping info into Session
Motivation:
Horizon is storing the result of policy check for each panel in the Django session.
This was added in this patch: https:/
It contributes to session size growing and eventually hitting the cookie size limit when signed cookie session backend is used..
While testing, it was found that it contributes 34% of the session size.
Description:
There are a number of items to be implemented
1. Instead of caching the result into Session, move the cache to the Django cache
https:/
2. An entry in the django cache will be created for each scoped token:
- key: token_id
- value: cache policy_check
- expiration: token expiration
3. If no entry from the cache can be found, it will perform the policy check and add that in the cache
UX:
N/A
Outside Dependencies:
N/A
Requirements Update Required:
N/A Cache is available since Django14
Doc Impact:
Will have to document that deployer have to configure the Django Cache correctly.
Leverage django cache for this
Blueprint information
- Status:
- Complete
- Approver:
- David Lyle
- Priority:
- Undefined
- Drafter:
- Lin Hua Cheng
- Direction:
- Needs approval
- Assignee:
- Lin Hua Cheng
- Definition:
- Obsolete
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by
- David Lyle