[英]Django cache Bad Request (400)
I currently have my seetings file configures to use the memcache cache. 我目前有我的seetings文件配置为使用内存缓存。
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache'
Whilst the site runs flawlessly, I see debug lines such as: 该站点可以正常运行,但是我看到如下调试行:
[05/Dec/2014 15:28:53] code 400, message Bad HTTP/0.9 request type ('get')
[05/Dec/2014 15:28:53] "get :1:views.decorators.cache.cache_header..439e23553bea98b3b35e7b94c1f72576.en-gb.AUS_Eastern_Standard_Time" 400 -
[05/Dec/2014 15:28:53] "GET /RSA/ HTTP/1.1" 200 968
So I'm interested in learning how to fix this, and how I can actually test whether the backend cache is being used. 因此,我对学习如何解决此问题以及如何实际测试后端缓存是否正在使用感兴趣。 It is currently implemented to be used with all pages.
当前已实现为可用于所有页面。
Went back to the docks and started playing around with the port number for the location. 回到码头,开始玩该位置的端口号。
Was able to make it report a different error that referenced 63894
as being the correct port number. 能够报告另一个错误,该错误引用了
63894
作为正确的端口号。 Interesting to note that it was not the port the actual site was running off - 88
. 有趣的是,这不是实际站点在运行的端口
88
。 Maybe it was something to do with the fact that it was running with the django manage.py runserver
command and was only a development server etc. 也许这与它使用
django manage.py runserver
命令运行并且仅是开发服务器等有关。
Anyway this fixed the problem. 无论如何,这解决了问题。 Code below as a reference.
下面的代码作为参考。
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '127.0.0.1:63894',
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.