Open int-ua opened 9 years ago
This very problem plagues all popular methods of per-view cache invalidation starting from Django 1.7+, because it generates cache keys with full URL and port: http://stackoverflow.com/a/26403585/412240
I guess it can't be fixed easily without hardcoding server information...
Isn't it always contained in the ALLOWED_HOSTS
?
ALLOWED_HOSTS
don't include port numbers, may contain masks: e.g. ['*', ]
is perfectly valid, and the setting is ignored when DEBUG=True
.
I'm experimenting with subclassing caching middleware, hoping to be able to adjust how Django generates the keys when using @cache_page decorator.
Any updates on this?
Anyone figure this out?
I'm trying to expire cache for news pages after they've been edited by an administrator. With this code
I'm getting the KeyError: