First time here? Check out the FAQ!
0

How to make askbot work with memcached?

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.

jqy3222089's avatar
17
jqy3222089
asked 2013-05-01 08:33:37 -0500, updated 2013-05-03 07:34:36 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

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.

Evgeny's avatar
13.2k
Evgeny
answered 2013-05-01 12:48:37 -0500, updated 2013-05-14 14:42:32 -0500
edit flag offensive 0 remove flag delete link

Comments

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

jqy3222089's avatar jqy3222089 (2013-05-01 18:31:25 -0500) edit

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

Evgeny's avatar Evgeny (2013-05-01 18:37:11 -0500) 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's avatar jqy3222089 (2013-05-01 18:55:49 -0500) 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's avatar Evgeny (2013-05-01 18:59:15 -0500) edit

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

jqy3222089's avatar jqy3222089 (2013-05-01 19:13:51 -0500) edit
add a comment see more comments