Update Caching Documentation. (#357)

* update caching documentation

* fix typo

* Update README.md

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: Brandon Parker <brandon.parker@zapier.com>
Co-authored-by: Fabio Caccamo <fabio.caccamo@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
master
Brandon Parker 2024-01-29 12:06:16 -08:00 committed by GitHub
parent 0f3bf75ba4
commit da02334a35
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 21 additions and 1 deletions

View File

@ -66,7 +66,8 @@ SILENCED_SYSTEM_CHECKS = ["security.W019"]
- Run `python manage.py collectstatic --clear` - Run `python manage.py collectstatic --clear`
- Restart your application server - Restart your application server
> **Warning** - if you want use modals instead of popup windows, ensure to add `X_FRAME_OPTIONS = "SAMEORIGIN"` setting. > [!WARNING]
> if you want use modals instead of popup windows, ensure to add `X_FRAME_OPTIONS = "SAMEORIGIN"` setting.
### Optional features ### Optional features
To make a fieldset start expanded with a `Hide` button to collapse, add the class `"expanded"` to its classes: To make a fieldset start expanded with a `Hide` button to collapse, add the class `"expanded"` to its classes:
@ -183,6 +184,25 @@ At the moment, this package has been translated into the following languages: `d
If you do some changes to the project, remember to update translations, because if the translations files are not up-to-date, the `lint` step in the CI will fail: If you do some changes to the project, remember to update translations, because if the translations files are not up-to-date, the `lint` step in the CI will fail:
- Run `tox -e translations` - Run `tox -e translations`
## Caching
This package uses caching to improve theme load time and overall performance.
You can customise the app caching options using `settings.CACHES["admin_interface"]` setting, otherwise the `"default"` cache will be used:
```python
CACHES = {
# ...
"admin_interface": {
"BACKEND": "django.core.cache.backends.locmem.LocMemCache",
"TIMEOUT": 60 * 5,
},
# ...
}
```
> [!WARNING]
> There is a [known compatibility issue](https://github.com/fabiocaccamo/django-admin-interface/issues/356) when using this package with `django-redis`, more specifically, using the `JSONSerializer` the following error is raised: `TypeError: Object of type Theme is not JSON serializable`, to mitigate this problem, simply use a specific cache for this app that does not use any `json` serializer.
## FAQ ## FAQ
### Custom `base-site.html` ### Custom `base-site.html`