Skip to content

docs: use SOLO_CACHE='default' and warn about LocMemCache (#157) - #160

Open
AquaticAzelf wants to merge 1 commit into
lazybird:masterfrom
AquaticAzelf:fix/docs-cache-157
Open

docs: use SOLO_CACHE='default' and warn about LocMemCache (#157)#160
AquaticAzelf wants to merge 1 commit into
lazybird:masterfrom
AquaticAzelf:fix/docs-cache-157

Conversation

@AquaticAzelf

Copy link
Copy Markdown

Fixes #157

Problem: README.md:245 used SOLO_CACHE = 'local' which maps to LocMemCache. This is per-process (each worker has its own private cache) and is not memory-efficient — see Django docs: Local-memory caching. In multi-process production (gunicorn, uwsgi, etc.) this causes inconsistent singleton caching.

Solution: Change example to shared backend SOLO_CACHE = 'default' (Memcached) and add warning block:

Warning: LocMemCache is per-process (each process has its own private cache instance) and is not memory-efficient — see Django docs. Do not use SOLO_CACHE='local' in production with multiple processes/workers; use a shared backend (e.g. MemcachedCache/RedisCache) via SOLO_CACHE='default'.

Keep existing Caching will be disabled if set to None. sentence.

Verification (folder-local only, no global installs):

  • python -m venv .venv inside clone C:\Users\Azelf\AppData\Local\Temp\opencode\django-solo-fix, pip install -e . (installed django-solo 2.5.1, Django 6.1)
  • grep -n SOLO_CACHE README.md before: 245: SOLO_CACHE = 'local'; after: 245: SOLO_CACHE = 'default' plus warning line 248
  • python manage.py test solo --settings=solo.tests.settings — 13 tests OK (exit 0)
  • git diff shows 1 file changed, 3 insertions(+), 1 deletion(-)
  • Repo stars verified ~966 (not zero), docs-only low risk.

Files: README.md only.

Fixes lazybird#157: LocMemCache is per-process, not suitable for production. Change example to shared backend.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Changing the the cache exampl in README.md

1 participant