【发布时间】:2016-03-13 19:41:59
【问题描述】:
有人能解释一下the uwsgi docs 的以下 sn-p 是如何工作的吗?
cache2 = name=mycache,items=100
; load the mime types engine
mime-file = /etc/mime.types
; at each request starting with /img check it in the cache (use mime types engine for the content type)
route = ^/img/(.+) cache:key=/img/$1,name=mycache,mime=1
; at each request ending with .css check it in the cache
route = \.css$ cache:key=${REQUEST_URI},name=mycache,content_type=text/css
; fallback to text/html all of the others request
route = .* cache:key=${REQUEST_URI},name=mycache
; store each successful request (200 http status code) in the 'mycache' cache using the REQUEST_URI as key
route = .* cachestore:key=${REQUEST_URI},name=mycache
既然 ${REQUEST_URI} 用于存储缓存中的所有内容,但 ${REQUEST_URI} 的一部分用于检查缓存中的图像,这应该如何工作?我确实用 log: routing target 输出了 ${REQUEST_URI},它等于每次从第一个 / 开始的完整请求。
在我的设置中类似的东西不起作用(我使用 /usr/local/etc/nginx/mime.types 作为 mime 类型文件)。
谢谢, 吨。
【问题讨论】:
标签: uwsgi