mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-11-22 05:14:22 +00:00
Enhancement: Add a database caching for improved performance (#9784)
--------- Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
1 parent
6b248ef140
commit
1671d49d44
7 files changed
+309
-16
No files matched your search
@@ -0,0 +1,17 @@
|
||||
from cachalot.api import invalidate as cachalot_invalidate
|
||||
from cachalot.utils import get_query_cache_key
|
||||
from cachalot.utils import get_table_cache_key
|
||||
|
||||
PREFIX = "pngx_cachalot_"
|
||||
|
||||
|
||||
def custom_get_query_cache_key(compiler):
|
||||
return PREFIX + get_query_cache_key(compiler)
|
||||
|
||||
|
||||
def custom_get_table_cache_key(db_alias, table):
|
||||
return PREFIX + get_table_cache_key(db_alias, table)
|
||||
|
||||
|
||||
def invalidate_db_cache():
|
||||
return cachalot_invalidate(cache_alias="read-cache")
|
||||
Reference in new issue
Block a user