python - 使用django 的@etag(etag_entry),etag都返回的固定的,每次都一样,为啥总是返回200,不返回304?
巴扎黑
巴扎黑 2017-04-17 17:43:24
0
1
321

1.使用django 的@etag(etag_entry),etag都返回的固定的,每次都一样,为啥总是返回200,不返回304?@last_modified(latest_entry)是可以返回304的。

代码如下:

def latest_entry(request):

return django_condition.objects.all().latest("published").published

def etag_entry(request):

return 'zk_test_etag'

#@condition(last_modified_func=latest_entry)

@etag(etag_entry)
def etagtest(request):

print request.META
return HttpResponse('last_modified_etag_testing')

巴扎黑
巴扎黑

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!