- Issue created by @danflanagan8
- πΊπΈUnited States danflanagan8 St. Louis, US
I'm learnin' stuff here.
I tried extending Symfony's BinaryFileResponse such that it was cacheable and I got this error:
Exception: Serialization of 'Symfony\Component\HttpFoundation\File\File' is not allowed in serialize() (line 245 of core/lib/Drupal/Core/Cache/DatabaseBackend.php).
So it's impossible to cache a BinaryFileResponse.
I can cache the various 4XX responses from the controller, but that 200 can't be cached if it uses DISPOSITION_ATTACHMENT.
That's actually probably ok.
- πΊπΈUnited States danflanagan8 St. Louis, US
I've decided we should always force a download. We'll always use DISPOSITION_ATTACHMENT and never use DISPOSITION_INLINE. The 40x responses can be cached, but the 200 response can't be. That should be ok. It loads an hpt entity and a file entity and checks access and that's it. That's not a ton of overhead considering those loads will be cached.
This patch updates the controller and removes anything related to a "view" link being distinct from a download link.
- Status changed to Needs review
over 1 year ago 5:13pm 14 July 2023 - last update
over 1 year ago 3 pass, 2 fail The last submitted patch, 4: hpt-attachment-3374733-4.patch, failed testing. View results β
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.-
danflanagan8 β
committed 83867ecb on 1.0.x
Issue #3374733 by danflanagan8: Update hpt controller to support...
-
danflanagan8 β
committed 83867ecb on 1.0.x
- Status changed to Fixed
over 1 year ago 5:52pm 14 July 2023 Automatically closed - issue fixed for 2 weeks with no activity.