【文件属性】:
文件名称:pyramid_cachebust:Pyramid 的缓存破坏
文件大小:6KB
文件格式:ZIP
更新时间:2021-07-01 02:13:45
Python
金字塔大*
通过查询字符串参数缓存静态资产。
安装
通过点子:
pip install pyramid_cachebust
设置
通过include方法添加到您的配置器:
config = Configurator()
config.include('pyramid_cachebust')
config.add_static_view('static', 'myapp:static')
现在pyramid.request.Request有两个新方法: cachebusted_path和cachebusted_url 。 这些方法是request.static_path和request.static_url包装器,并在缓存破坏查询参数上添加了标记:
request.cachebusted_path('myapp:static/file.css')
>>> '/static/fi
【文件预览】:
pyramid_cachebust-master
----LICENSE.txt(1KB)
----setup.py(1KB)
----README.md(2KB)
----pyramid_cachebust()
--------cachebust.py(5KB)
--------tests.py(730B)
--------__init__.py(901B)
----.gitignore(6B)