patch_cache_control should replace public/private setting if already set
|Reported by:||AndiDog||Owned by:||AndiDog|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
In the following scenario
@_cache_control_iff_user_is_anonymous(public = True, must_revalidate = False, max_age = 60) @cache_control(private = True, must_revalidate = True, max_age = 1200) @vary_on_cookie def myView(request): ...
I am applying the private caching attribute by default, and want to replace "private" with "public" iff the user is not logged in (for more aggressive caching).
But what I get with the above code is "Cache-Control: public, private, must-revalidate=False, max-age=60". So instead of just adding the "public" attribute, one should as well remove the "private" attribute.
See attached diff for a simple solution.
Change History (15)
comment:1 Changed 3 years ago by russellm
- Component changed from Cache system to HTTP handling
- Needs documentation set
- Needs tests set
- Patch needs improvement set
- Triage Stage changed from Unreviewed to Accepted
comment:2 Changed 3 years ago by AndiDog
- Owner changed from nobody to AndiDog
- Status changed from new to assigned
comment:4 Changed 3 years ago by AndiDog
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:10 Changed 3 years ago by russellm
- Resolution set to fixed
- Status changed from assigned to closed