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.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
jqy3222089's avatar
17
jqy3222089
asked 11 years ago, updated 11 years ago

Comments

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.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
answered 11 years ago, updated 11 years ago
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 (11 years ago)

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

Evgeny's avatar Evgeny (11 years ago)

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 (11 years ago)
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 (11 years ago)

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

jqy3222089's avatar jqy3222089 (11 years ago)
see more comments