[Bug 41929] New: Add Cache-Control to opac-retrieve-file.pl
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41929 Bug ID: 41929 Summary: Add Cache-Control to opac-retrieve-file.pl Initiative type: --- Sponsorship --- status: Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: lari.taskula@hypernova.fi QA Contact: testopia@bugs.koha-community.org It seems unnecessary to re-fetch the files served by opac-retrieve-file.pl on each request. Files served by opac-retrieve-file.pl are files uploaded by Tools > Uploads and marked as public. They are each assigned a hash value, and referenced by the "id" query parameter when loaded through opac-retrieve-file.pl. We should let browsers cache these files to reduce the load if for example these files are used by the OPAC content management to load images, fonts etc. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41929 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|oleonard@myacpl.org |lari.taskula@hypernova.fi -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41929 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41929 --- Comment #1 from Lari Taskula <lari.taskula@hypernova.fi> --- Created attachment 193937 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=193937&action=edit Bug 41929: Enable Cache-Control for UploadedFiles This patch adds Cache-Control header to Koha::UploadedFile->httpheaders. Cache-Control is set public and max-age at 12 hours for uploaded files that are marked as public, ie. retrieveable by opac-retrieve-file.pl. This reduces server load as browsers are allowed to cache the files. Useful for libraries that upload images and fonts via the upload tool, and serve them publicly in OPAC. As for files not marked public by the upload tool, Cache-Control tells browsers not to cache these files, as they may contain private and sensitive information. To test: 1. prove t/db_dependent/Upload.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41929 Laura Escamilla <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41929 Laura Escamilla <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #193937|0 |1 is obsolete| | --- Comment #2 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 194015 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=194015&action=edit Bug 41929: Enable Cache-Control for UploadedFiles This patch adds Cache-Control header to Koha::UploadedFile->httpheaders. Cache-Control is set public and max-age at 12 hours for uploaded files that are marked as public, ie. retrieveable by opac-retrieve-file.pl. This reduces server load as browsers are allowed to cache the files. Useful for libraries that upload images and fonts via the upload tool, and serve them publicly in OPAC. As for files not marked public by the upload tool, Cache-Control tells browsers not to cache these files, as they may contain private and sensitive information. To test: 1. prove t/db_dependent/Upload.t Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
As for files not marked public by the upload tool, Cache-Control tells browsers not to cache these files, as they may contain private and sensitive information. In some cases files marked as public may as well contain sensitive information and caching them on the disk may go against your organization's security
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41929 Lari Taskula <lari.taskula@hypernova.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #3 from Lari Taskula <lari.taskula@hypernova.fi> --- (In reply to Lari Taskula from comment #1) policies. This would of course require OPAC being restricted from public access in the first place. Perhaps it's better to add the uploaded file a new setting that when checked, allows the file to be cached. The default would be not to cache the files. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org