I create my own slightly changed cache middleware (replace get_full_path to 
build_absolute_uri)
http://macrotoma.blogspot.com/2012/06/custom-multisite-caching-on-django.html
 

четверг, 19 ноября 2009 г., 13:16:52 UTC+2 пользователь jens написал:
>
> There exist some "intersection" on multi site installation, if i use 
> django.middleware.cache.UpdateCacheMiddleware and 
> django.middleware.cache.FetchFromCacheMiddleware 
>
> Problem: 
> The cache key would be only generated based on the url without the 
> domain name. So if the page /foobar/ exist on site A and site B but 
> with different content, they would be only caches one time. 
>
> Solutions: 
> 1. The user can insert this into his settings: 
> CACHE_MIDDLEWARE_KEY_PREFIX = "FooBar %s" % SITE_ID 
>
> 2. Django should insert the SITE_ID into cache key. e.g. in 
> django.utils.cache.get_cache_key() 
>
> 3. Django should use the complete path to build the cache key. e.g.: 
> use request.build_absolute_uri() in 
> django.utils.cache._generate_cache_header_key() instead of iri_to_uri 
> (request.path) 
>
> Mfg. 
>
> Jens Diemer 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-developers/-/2mh_p3Uihp0J.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to