开发者

Django staticgenerator vs CACHE_BACKEND

Is there any difference between staticgenerator and useing Django's CACHE_BACKEND on the filesystem eg. CACHE_BACKEND = 'file:///var/开发者_运维百科tmp/django_cache' ?


Yes.

StaticGenerator generates static HTML files to bypass Django entirely.

Any caching that django does such as the filesystem cache is still processed by django. A lot of the overhead of running your app is still there: django processes a request, goes through middlewares, checks filesystem cache for content, etc.

With StaticGenerator (and their example), nginx is serving the index.html page if it exists and if it doesn't, passes the request on to django on apache.

The idea is to have nginx blissfully serving some html file that StaticGenerator updates on state changes (like saving a model).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜