Ask Your Question
0

How to make askbot work with memcached?

asked 2013-05-01 08:33:37 -0600

jqy3222089 gravatar image

updated 2013-05-03 07:34:36 -0600

In the settings.py of production server, I added

 CACHES = {
     'default': {
             'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
            'LOCATION': 'unix:xxx/memcached.sock',
        }
 }

Also added middleware in the file. memcached is started. But when i tried to run askbot in the production mode, it seems like some files, like css file, javascript file, need to be requested from cache. Some links are like: http://xxx.webfactional.com/m/CACHE/js/85190e85e697.js

But it can't be found in the server side. How to configure memcached for the per-site cache?

Many thanks.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-05-01 12:48:37 -0600

Evgeny gravatar image

updated 2013-05-14 14:42:32 -0600

Do you mean that /CACHE/ in the file path means it should be coming from the memcached? Actually - it does not. There is no connection between the /CACHE/ directory and the memory object caching (memcached or any other - at all).

Directory /CACHE/ will be created in your static files directory by the django-compressor app. You will need to make sure to make that directory writeable by the webserver.

It's just a directory name. If your site is working with that configuration, that means your memcached is fine.

edit flag offensive delete link more

Comments

I didn't use that path for the memcached, it was automatically changed into that way when i turned the debug off.

jqy3222089 gravatar imagejqy3222089 ( 2013-05-01 18:31:25 -0600 )edit

That path has nothing to do with memcached. What makes you think it is?

Evgeny gravatar imageEvgeny ( 2013-05-01 18:37:11 -0600 )edit

So what should I do when I need to deploy ASKBOT into a production server? Just turn off the debug mode did not work since I have tried this in the server.

jqy3222089 gravatar imagejqy3222089 ( 2013-05-01 18:55:49 -0600 )edit
1

You can't see the .css and .js files? Do you have directory CACHE inside the static files directory? If not - please create it and change permissions so that the webserver can write into that directory.

Evgeny gravatar imageEvgeny ( 2013-05-01 18:59:15 -0600 )edit

That's the problem. After creating CACHE directory, it's working now. Many thanks!@Evgeny

jqy3222089 gravatar imagejqy3222089 ( 2013-05-01 19:13:51 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-05-01 08:33:37 -0600

Seen: 1,522 times

Last updated: May 14 '13