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

  • Home
  • SEARCH
  • 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 7953941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:16:32+00:00 2026-06-04T03:16:32+00:00

I have setup memcached (unix socket) for my django application. However it seems that

  • 0

I have setup memcached (unix socket) for my django application. However it seems that some ajax requests do not work, as expected, while memcached is on. I am using memcached on my entire site.

For example in this javascript function the .load() directive works the first time, but after that it keeps ‘fetching’ the same page from cache.

function placeBet(user, bet) {
    var ajax_data = {
        status:false,
        message: ''
    }

    $.ajax({
        url:'/place_bet/' + user + '/?ajax=&bet=' + bet,
        type:"POST",
        dataType:"json",
        data:ajax_data,
        success:function (data){
            var message = "";
            $('#user_open_bets').load('/ob/' + user + '/?ajax=');
            if (data.status == false){
                alert(data.message);
            }
        } // success
    }); // ajax
}

How can I force those ajax request to reload from database instead from cache?

EDIT.

This is my settings.py MIDDLEWARE classes

 MIDDLEWARE_CLASSES = (
     'django.middleware.cache.UpdateCacheMiddleware',
     'django.middleware.common.CommonMiddleware',
     'django.contrib.sessions.middleware.SessionMiddleware',
     'django.middleware.csrf.CsrfViewMiddleware',
     'django.contrib.auth.middleware.AuthenticationMiddleware',
     'django.contrib.messages.middleware.MessageMiddleware',
     'debug_toolbar.middleware.DebugToolbarMiddleware',
     'django.middleware.clickjacking.XFrameOptionsMiddleware',
     'main.common.tz_middleware.TimezoneMiddleware',
     'main.common.sslMiddleware.SSLRedirect',
     'django.middleware.cache.FetchFromCacheMiddleware',
  • 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-04T03:16:33+00:00Added an answer on June 4, 2026 at 3:16 am

    It seems that the answer was simpler than I thought. I found the solution in the django docs.

    https://docs.djangoproject.com/en/dev/topics/cache/#controlling-cache-using-other-headers

    I copy paste (for other people to know)

    from django.views.decorators.cache import never_cache
    
    @never_cache
    def myview(request):
        # ...
    

    Having said that, @Alex’s suggestion seems interesting and I would like to try it. However now my server is down for migration reasons. I need to wait for some hours. I will report here, later.

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

Sidebar

Related Questions

I have setup multiple SQL Service Broker Queues in a database but have not
I have one server running memcached and another server that should be able to
My problem is that memcache logic inside my cakePHP application is not working on
I have setup the following in my urls.py: (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}) and my
I have setup some tabbed navigation on my ASP.NET Masterpage. It is pretty basic:
I have setup a WCF service that i am running on IIS 7 that
If I have a spring application that uses ehcache, will ehcache run in the
I need to install and run memcached for an application. I have my own
I have cron jobs setup that runs a few PHP scripts often. The issue
I have setup some cron jobs and they send the crons result to an

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.