issues
search
ministryofjustice
/
justice-gov-uk
Justice UK website
https://www.justice.gov.uk/
MIT License
2
stars
0
forks
source link
Documents post type and customisation for our application.
#87
Closed
EarthlingDavey
closed
6 months ago
EarthlingDavey
commented
6 months ago
Now that S3 upload is working, it's safe to set 'remove-local-file' => true in the plugin's settings.
Increase upload file limits for local and prod. This is because the existing file sizes are up to 150M.
Implement an application level limit of 64MB on non-document uploads.
Set comment_status to false by default.
Turn off gzip compression for zip files.
Redirect the user download the file directly from the CDN for large public documents only.
I was seeing out of memory errors during testing.
The default behaviour for wp-document-revisions is to stream the files through the php application.
This is great for security, but a waste of resources if the file can just be served via the CDN.
The current code will redirect document urls (temporary 302) to the CDN if they're over 15MB.
For specific file types, they are marked with metadate in S3,
ContentDisposition
indicates that the browser should download it.
filename
is also set on the metadata, to prevent the CDN served files having the md5 hash as the filename.
Perhaps with url signing, this method could also be used with private files, i.e. on the intranet.
ContentDisposition
indicates that the browser should download it.filename
is also set on the metadata, to prevent the CDN served files having the md5 hash as the filename.