2011-03-04 80 views

回答

2

是的,只是cache your site as normal並確保FetchFromCacheMiddlewareFlatpageFallbackMiddleware之前。在這種情況下,緩存不需要在應用程序級別完成。

0

更好的辦法做到這只是緩存簡單頁面訪問量(不緩存所有的觀點!)

我建議是這樣的:

from django.contrib.flatpages import views 
from django.views.decorators.cache import cache_page 

urlpatterns = [ 
    url(r'^pages/(?P<url>.*)$', cache_page(60 * 60)(views.flatpage), name='django.contrib.flatpages.views.flatpage'), 
    # other routes here ... 
    ] 
相關問題