Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7712587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:40:09+00:00 2026-06-01T01:40:09+00:00

I have enabled site-wide Django caching , but the third-party apps I am using

  • 0

I have enabled site-wide Django caching, but the third-party apps I am using have not specified any cache-control expectations. So, I am guessing that their views will get cached.

The problem is that I do not want Django to cache the views of some apps. How do I apply url-level cache control on include()?

url(r"^account/", include("pinax.apps.account.urls")) #How to apply cache control here?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T01:40:10+00:00Added an answer on June 1, 2026 at 1:40 am

    You can’t. The per-site cache is achieved through middlewares which considers only request and response instead of specific view.

    However, you could achieve this by providing a patched django.middleware.cache.FetchFromCacheMiddleware.

    class ManagedFetchFromCacheMiddle(FetchFromCacheMiddleware):
        def process_request(self, request):
            if should_exempt(request):
                request._cache_update_cache = False
                return
            return super(ManagedFetchFromCacheMiddle, self).process_request(request)
    
    def should_exempt(request):
        """Any predicator to exempt cache on a request
        For your case, it looks like
    
        if request.path.startswith('/account/'):
            return True
        """
    

    Replace ‘django.middleware.cache.FetchFromCacheMiddleware’ with the path of the above in MIDDLEWARE_CLASSES.

    Maybe generic version of above is suitable for commiting patch to Django community =p

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form in a jQuery enabled site. The form does not feature
I have an Ajax.Net enabled ASP.Net 2.0 web site. Hosting for both the site
I have a web service site that is restful enabled, so other websites/ajax script
I have an AJAX-enabled SharePoint 2007 site. I have also created a user control
I have a fairly large Drupal 6 site with different modules enabled for different
I want to enable Authorization on the Site map provider. We have enabled anonymous
Under the site-enabled www.test.com , I have multiple VirtualHost configurations. ServerName varies (eg. test1.com
Hey guys I have enabled APC on my VPS but now I can't access
I have enabled anonymous users on the farm and on the entire site. I
I have translations enabled for page and profile (I am using the Content Profile

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.