简体   繁体   English

如何告诉Django不要将缓存用于请求?

[英]How to tell Django not to use the cache for a request?

I am using Django's caching framework with Memcached: https://docs.djangoproject.com/en/2.2/topics/cache/#django-s-cache-framework 我正在Memcached中使用Django的缓存框架: https : //docs.djangoproject.com/en/2.2/topics/cache/#django-s-cache-framework

It's working great. 效果很好。 The only issue I am having is sometimes, I want to make a request to my Django server and tell it to bypass the cache. 我唯一遇到的问题有时是,我想向Django服务器发出请求,并告诉它绕过缓存。 But I couldn't find any documentation on this. 但是我找不到关于此的任何文档。

How do I make a request to a Django server and tell it to not use the cache for this particular request? 如何向Django服务器发出请求,并告诉它不要对特定请求使用缓存?

How about put additional logic in request processor? 如何在请求处理器中添加其他逻辑? For example, send additional header (or get or post parameter or cookie) and if header exists in request then bypass the cache. 例如,发送其他标头(或get或post参数或cookie),如果请求中存在标头,则绕过缓存。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM