[ZCM] [ZC] 2310/ 1 Request "AcceleratedHTTPCacheManager.manage_editProps doesn't treat anonymous_only setting well"
"Collector: Zope Bugs, Features, and Patches ..." <[email protected]> Fri, 13 Apr 2007 05:49:12 -0400
| Newsgroups | gmane.comp.web.zope.devel.collector-monitor |
|---|---|
| Message-ID | <[email protected]> |
Issue #2310 Update (Request) "AcceleratedHTTPCacheManager.manage_editProps doesn't treat anonymous_only setting well"
Status Pending, Zope/bug+solution low
To followup, visit:
http://www.zope.org/Collectors/Zope/2310
==============================================================
= Request - Entry #1 by madarche on Apr 13, 2007 5:49 am
Uploaded: "AcceleratedHTTPCacheManager.manage_editProps.patch"
- http://www.zope.org/Collectors/Zope/2310/AcceleratedHTTPCacheManager.manage_editProps.patch/view
The AcceleratedHTTPCacheManager.manage_editProps method doesn't treat the "anonymous_only" setting well.
I've discovered this problem when using AcceleratedHTTPCacheManager in conjunction with GenericSetup.
Current code :
self._settings = {
'anonymous_only':settings.get('anonymous_only') and 1 or 0,
'interval':int(settings['interval']),
'notify_urls':tuple(settings['notify_urls']),}
The "anonymous_only" setting should be dealt with exactly the other parameters otherwise automating the configuration of AcceleratedHTTPCacheManager is hard. I guess that the current behavior is due to legacy code that didn't have the "anonymous_only" property. I don't think that the fact that "anonymous_only" was not used before is still pertinent now.
Desired code :
self._settings = {
'anonymous_only':int(settings['anonymous_only']),
'interval':int(settings['interval']),
'notify_urls':tuple(settings['notify_urls']),}
If supporting very old improbable legacy settings is still wanted one could rather have the following code :
if settings.get('anonymous_only', None) is None:
settings['anonymous_only'] = 1
self._settings = {
'anonymous_only':int(settings['anonymous_only']),
'interval':int(settings['interval']),
'notify_urls':tuple(settings['notify_urls']),}
==============================================================