Is there a way to be sure that a page is coming from cache on a production server and on the development server as well?
The solution shouldn't involve caching middleware because not every project uses them. Though the solution itself might be a middleware.
Just checking if the data is stale is not a very safe testing method IMO.
...
I'm testing out using memcached to cache django views. How can I tell if memcached is actually caching anything from the Linux command line?
...
I'm working on a small project, and I wanted to provide multiple caching options to the end user. I figured with Django it's pretty simplistic to swap memcached for database or file based caching. My memcached implementation works like a champ without any issues. I placed time stamps on my pages, and curl consistently shows the older tim...
I am running Django (1.0.2) on Google App Engine, and would like to know which (if any) of the following Django caching modules ought to inherently work with Google's memcache implementation:
Middlewear
django.middleware.cache.UpdateCacheMiddleware
django.middleware.common.CommonMiddleware
django.middleware.cache.FetchFromCacheMiddlew...
I've got a small snippet that I want in my sidebar. The snippet will be visible on each page, and while cheap to fetch (about 50ms on my super-slow netbook!), will change so infrequently that I'd quite like to cache it (partly because I've yet to use Django's cache framework, and I'd like to learn).
I'm not sure what the best way to go ...
I have a dozen or so permission lookups on views that make sure users have the right permissions to do something on the system (ie make sure they're in the right group, if they can edit their profile, if they're group administrators, etc).
A check might look like this:
from django.contrib.auth.decorators import user_passes_test
test_c...
Does anyone know about any solutions for keeping data bigger, than 1mb in memcached ?
This is no big deal to cut big data to 1mb pieces before setting and merge this pieces after getting from memcached. And this algorithm can work transparently for users.
This can works on the base of this snippet http://www.djangosnippets.org/snippe...
I would like to implement a decorator that provides per-request caching to any method, not just views. Here is an example use case.
I have a custom tag that determines if
a record in a long list of records is
a "favorite". In order to check if an
item is a favorite, you have to query
the database. Ideally, you would
perform...
I have a Django app where users can select between 2 interface modes, that mode affect some pages... for those pages I use different templates
In urls.py I have something like this:
mode = Config.objects.get().mode
urlpatterns = patterns('',
url(r'^my_url/$', 'custom_view', {'template':'my_template.html', 'mode':mode} ),
)
Then m...