Does SQLAlchemy support caching?

We have a pretty comprehensive caching solution, as an example in conjunction with embedded hooks, in 0.6. It’s a recipe to subclass Query, make it aware of Beaker, and allow control of query caching for explicit queries as well as lazy loaders via query options. I’m running it in production now. The example itself is … Read more

Which .NET Memcached client do you use, EnyimMemcached vs. BeITMemcached? [closed]

We tested both and found Enyim to perform the best for our expected usage scenario: many (but not millions) cached objects, and millions of cache-get requests (average web site concurrency load = 16-20 requests.) Our performance factor was measuring the time from making the request to having the object initialized in memory on the calling … Read more

Is it OK to use HttpRuntime.Cache outside ASP.NET applications?

I realize this question is old, but in the interest of helping anyone who finds this via search, its worth noting that .net v4 includes a new general purpose cache for this type of scenario. It’s in the System.Runtime.Caching namespace: https://msdn.microsoft.com/en-us/library/dd997357(v=vs.110).aspx The static reference to the default cache instance is: MemoryCache.Default

Does it make sense to have max-age and s-maxage in the Cache-Control HTTP header?

From HTTP Header Field Definitions: 14.9.3 Modifications of the Basic Expiration Mechanism … s-maxage If a response includes an s-maxage directive, then for a shared cache (but not for a private cache), the maximum age specified by this directive overrides the maximum age specified by either the max-age directive or the Expires header. … Note, … Read more

How to cache Django Rest Framework API calls?

Ok, so, in order to use caching for your queryset: class ProductListAPIView(generics.ListAPIView): def get_queryset(self): return get_myobj() serializer_class = ProductSerializer You’d probably want to set a timeout on the cache set though (like 60 seconds): cache.set(cache_key, result, 60) If you want to cache the whole view: from django.utils.decorators import method_decorator from django.views.decorators.cache import cache_page class ProductListAPIView(generics.ListAPIView): … Read more