This avoids edge cases caused by unreliable data storage in production. But unless your cache is definitelyĬonfigured for sufficient persistence, opt for the cached database backend. The cache backend can be made persistent by using a persistent cache, such as Up or the cache server is restarted, and it will mean session data is lost, This isįaster because it avoids database persistence, but you will have to consider The cache backend ( cache) stores session data only in your cache. Instructions for the using database-backed sessions. ".cached_db", and follow the configuration Use the cache, or the database if the data has been evicted from the cache. Session writes are applied to both the cache and the database. The cached database backend ( cached_db) uses a write-through cache – Once your cache is configured, you have to choose between a database-backed To use another cache, set SESSION_CACHE_ALIAS to the If you have multiple caches defined in CACHES, Django will use theĭefault cache. NOT multi-process safe, therefore probably not a good choice for production Additionally, the local-memory cache backend is Long enough to be a good choice, and it’ll be faster to use file orĭatabase sessions directly instead of sending everything through the file The local-memory cache backend doesn’t retain data You should only use cache-based sessions if you’re using the Memcached or
0 Comments
Leave a Reply. |