WISVCH / dienst2

CH Dienstensysteem: administratie van leden en post
https://dienst2.ch.tudelft.nl
Other
4 stars 2 forks source link

Deployment: remove memcached #294

Closed praseodym closed 1 year ago

praseodym commented 2 years ago

Let's just create sessions in the database instead of deploying memcached.

jgadelange commented 2 years ago

Isn't memcached use for caching instead of sessions? 🤔

Default for sessions is db storage: so just don't set it for production should be the way to go for this

SESSION_ENGINE = env("SESSION_ENGINE", default="django.contrib.sessions.backends.db")
praseodym commented 2 years ago

Production config is as follows:

CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
        'LOCATION': 'localhost:11211',
        'KEY_PREFIX': 'dienst2',
    }
}

SESSION_ENGINE = 'django.contrib.sessions.backends.cache'

And I don't think the cache is used anywhere else?

jgadelange commented 2 years ago

Django does some automatic caching for some stuff, but not sure what exactly 😅

We could also switch the cache to db or maybe local memory

praseodym commented 2 years ago

Local memory cache + sessions in database sounds like the way to go.

JoepdeJong commented 1 year ago

Resolved with https://github.com/WISVCH/dienst2/pull/311