0

I setup Django Cache with Memcached (with pylibmc backend).

My settings look like this:

CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache',
        'LOCATION': 'LOCATION:PORT',
    }
}

I am only caching a view using the cache_page() decorator.

From my end, everything seems to be working fine for this cached view. However, when I use Google PageSpeed Insights on the URL, every other run returns a 500 error.

My error logs don't seem to show any information. Just that 500 errors were returned for the Google PageSpeed Bot.

The website is not under heavy-load, so i don't think there is any cache stampede or similar issue involved.

Any help here, thank you.

EDIT: I noticed that when I set DEBUG=True. This problem seems to go away... but of course I cannot leave DEBUG=True.

Astar
  • 258
  • 4
  • 14
  • Do you have a load balancer in front of the Django server? How about a reverse proxy like Nginx? – Mark B Sep 25 '16 at 21:21
  • Yes I have a load balancer. No reverse proxy that I'm aware of. Launched the application with elastic beanstalk. – Astar Sep 26 '16 at 01:42
  • Elastic beanstalk uses a reverse proxy. You need to be checking all the logs. Also, do you have more than one server behind the load balancer? – Mark B Sep 26 '16 at 03:11
  • No, I only have 1 server. Which log files should I look into, the error log files don't seem to show anything. – Astar Sep 26 '16 at 03:45

0 Answers0