A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
Add Cache-Control header for thumbnails
CkuT79868930f153
diff --git a/src/documents/views.py b/src/documents/views.pyindex 186b733a5..f72ca22b1 100644--- a/src/documents/views.py+++ b/src/documents/views.py@@ -2,6 +2,7 @@ from django.http import HttpResponse, HttpResponseBadRequestfrom django.views.generic import DetailView, FormView, TemplateViewfrom django_filters.rest_framework import DjangoFilterBackendfrom django.conf import settings+from django.utils import cachefrom paperless.db import GnuPGfrom paperless.mixins import SessionOrBasicAuthMixin@@ -56,10 +57,12 @@ class FetchView(SessionOrBasicAuthMixin, DetailView):}if self.kwargs["kind"] == "thumb":- return HttpResponse(+ response = HttpResponse(self._get_raw_data(self.object.thumbnail_file),content_type=content_types[Document.TYPE_PNG])+ cache.patch_cache_control(response, max_age=31536000, private=True)+ return responseresponse = HttpResponse(self._get_raw_data(self.object.source_file),