Re: CacheMiddleware issue

2008-03-28 Thread bfrederi
It absolutely does work, I just didn't know what I was doing: return HttpResponse(response_file.read(), mimetype=response_mimetype) Thanks :) On Mar 28, 1:00 pm, Mike Axiak <[EMAIL PROTECTED]> wrote: > Does the following code change not work? >http://dpaste.com/41855/ > > Cheers, > Mike > >

Re: CacheMiddleware issue

2008-03-28 Thread Mike Axiak
Does the following code change not work? http://dpaste.com/41855/ Cheers, Mike On Mar 28, 1:16 pm, bfrederi <[EMAIL PROTECTED]> wrote: > Mike, > > I'm not exactly sure how to do a read and get the file to be cached in > memory with the middleware. If you look at the links I posted to my > cod

Re: CacheMiddleware issue

2008-03-28 Thread bfrederi
Mike, I'm not exactly sure how to do a read and get the file to be cached in memory with the middleware. If you look at the links I posted to my code, how would I cache the file within that view I posted? The decorator you specified worked perfectly fine for disabling the cache middleware for tha

Re: CacheMiddleware issue

2008-03-28 Thread bfrederi
Mike, Thank you very much for explaining it to me. I had no idea that the cache middleware wouldn't read the file and cache it along with the response. I figured caching the file itself as well would be redundant, which could be costly depending on the size of these files I am storing in memory.

Re: CacheMiddleware issue

2008-03-27 Thread Mike Axiak
Brandon, It appears that the Cache Middleware does not read the content from the file before caching the response [1]. I'm not sure if this is a bug or not...though I'd probably lean towards it being a bug. (Do we not cache middleware to *always* evaluate a file object before caching the response

Re: CacheMiddleware issue

2008-03-27 Thread bfrederi
I appreciate the help Rajesh, I haven't added any special settings for the cachemiddleware, I just placed 'django.middleware.cache.CacheMiddleware' in my middleware classes and that's it. As far as the low-level caching that I have written into my code using the "from django.core.cache import cac

Re: CacheMiddleware issue

2008-03-27 Thread Rajesh Dhawan
Hi Brandon, > > I would paste in some code examples, but this project is several > hundred lines long, and there are several incidences where I open > files that is conflicting with the cache middleware. Not knowing how you have your cache setup (anonymous, all views, low- level), it's hard to t