Re: [Django] #11997: cache_control returns 200 OK response even page has not been changed.

2015-03-21 Thread Django
#11997: cache_control returns 200 OK response even page has not been changed.
-+-
 Reporter:  jtiai|Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Core (Cache system)  |  Version:  master
 Severity:  Normal   |   Resolution:  needsinfo
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by claudep):

 * status:  new => closed
 * resolution:   => needsinfo


Comment:

 I think that the response of the server is strongly dependent of installed
 middlewares. Typically, the 304 response you expect would be produced by
 the `ConditionalGetMiddleware`.

 If you still suffer from this issue, the best step forward would be to
 setup a minimal project to reproduce the issue, so as we can debug cache
 and middleware interactions.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.10cc2c518fe2e5558b11f439bc59675f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #11997: cache_control returns 200 OK response even page has not been changed.

2011-04-23 Thread Django
#11997: cache_control returns 200 OK response even page has not been changed.
+-
   Reporter:  jtiai |  Owner:  nobody
   Type:  Bug   | Status:  new
  Milestone:|  Component:  Core (Cache system)
Version:  SVN   |   Severity:  Normal
 Resolution:|   Keywords:
   Triage Stage:  Accepted  |  Has patch:  0
Needs documentation:  0 |Needs tests:  0
Patch needs improvement:  0 |  Easy pickings:  0
+-
Changes (by niwi@…):

 * type:   => Bug
 * severity:   => Normal
 * easy:   => 0


Comment:

 I passed something similar, using Generic Class Views.
 With DEBUG=True works ok (Returns 304), but with DEBUG=False always
 returns 200 (And it creates a new cache entry for each request)

 Database select with DEBUG=True

 {{{
 sqlite> select cache_key from testcache;
 :1:views.decorators.cache.cache_header..0d315d531c1d665a169d1c5df90c50eb.es
 
:1:views.decorators.cache.cache_page..GET.0d315d531c1d665a169d1c5df90c50eb.cc775e21f18c02dc9fb51010878bc022.es
 sqlite> delete from testcache;
 }}}


 Database select with DEBUG=False
 {{{
 sqlite> select cache_key from testcache;
 :1:views.decorators.cache.cache_header..0d315d531c1d665a169d1c5df90c50eb.es
 
:1:views.decorators.cache.cache_page..GET.0d315d531c1d665a169d1c5df90c50eb.cc775e21f18c02dc9fb51010878bc022.es
 
:1:views.decorators.cache.cache_page..GET.0d315d531c1d665a169d1c5df90c50eb.52984fbac17d6264bc671574cc7f150b.es
 
:1:views.decorators.cache.cache_page..GET.0d315d531c1d665a169d1c5df90c50eb.6e721d5f3f637978913099b512dab876.es
 
:1:views.decorators.cache.cache_page..GET.0d315d531c1d665a169d1c5df90c50eb.c76a223f2cb4df2a5b27cc2acd7b23ff.es
 
:1:views.decorators.cache.cache_page..GET.0d315d531c1d665a169d1c5df90c50eb.53da06fed77acf71813587833708.es
 
:1:views.decorators.cache.cache_page..GET.0d315d531c1d665a169d1c5df90c50eb.4d44279ce9d42c1cdc41ff9fba74bfa1.es
 
:1:views.decorators.cache.cache_page..GET.0d315d531c1d665a169d1c5df90c50eb.5068bbfa80f990c0fca3a42173d203c8.es
 
:1:views.decorators.cache.cache_page..GET.0d315d531c1d665a169d1c5df90c50eb.662c59ccdd121bfe051841e975b46580.es
 [...]
 }}}


 Class View used for this test.
 {{{
 class CacheMixIn(object):
 """ Class for generic cache decorator. """
 @method_decorator(cache_page(60*2))
 @method_decorator(vary_on_headers('User-Agent', 'Cookie'))
 def dispatch(self, *args, **kwargs):
 return super(CacheMixIn, self).dispatch(*args, **kwargs)


 class ObjectListMixIn(ListView):
 """ Class for generic settings for all object list. """
 allow_empty = True
 paginate_by = 20


 class PostsView(CacheMixIn, ObjectListMixIn):
 queryset =
 Post.objects.exclude(public=False).order_by('-created_date')

 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



Re: [Django] #11997: cache_control returns 200 OK response even page has not been changed.

2010-02-03 Thread Django
#11997: cache_control returns 200 OK response even page has not been changed.
---+
  Reporter:  jtiai | Owner:  nobody
Status:  new   | Milestone:
 Component:  Cache system  |   Version:  SVN   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by russellm):

  * needs_better_patch:  => 0
  * stage:  Unreviewed => Accepted
  * needs_tests:  => 0
  * needs_docs:  => 0

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.