Django的render_to_response缓存是否从每个磁盘卸载模板或加载? [英] Does Django's render_to_response cache unrendered templates or load from disk every time?

查看:122
本文介绍了Django的render_to_response缓存是否从每个磁盘卸载模板或加载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从磁盘获取模板比将其从memcached中拖出来的速度要慢得多,所以每次从磁盘中加载它们都是浪费的。



Django缓存未渲染的模板在内存或$ code CACHE_BACKEND 或者我必须自己实现?

解决方案

Django附带了一个缓存的模板加载程序


Fetching a template from disk is significantly slower than pulling it out of something like memcached, so loading them from disk each time is wasteful.

Does Django cache unrendered templates in memory or in the CACHE_BACKEND or do I have to implement that myself?

解决方案

Django comes with a cached template loader as well.

这篇关于Django的render_to_response缓存是否从每个磁盘卸载模板或加载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆