For debugging and analyses, it would be very useful to make it easier to see the performance benefits of this plugin through various logs and whatnot.
What I had in mind:
In the editor
[x] Add Server-Timing headers on REST API responses so you can see how long it took to upload the image to WordPress
This is partially implemented, but haven't actually checked whether the values are correct. They look reasonable though.
[ ] Log file sizes to console during upload
[ ] Store information about file size savings (probably just the original file size) in post meta so we can later compare how much smaller the client-side generated file is
Maybe store the original file type too? This way we can know that e.g. an AVIF image was previously a JPEG.
[ ] Add some more debug logs in the editor. For example, after upload (or clicking the Optimize button), show before/after file size
[ ] Measure total upload time for the whole item, including thumbnail generation
That requires some changes to the upload flow so that we know when the upload is truly finished. How are parent and children connected? Using the parent's ID as the batch ID or something?
Related to #325
Start by adding startTime: performance.now() when adding an item to the queue
On the frontend
[ ] Add some HTML attribute to <img> tags to expose collected information (file size savings, original mime type, etc.) for HTTP Archive purposes.
For debugging and analyses, it would be very useful to make it easier to see the performance benefits of this plugin through various logs and whatnot.
What I had in mind:
In the editor
Server-Timing
headers on REST API responses so you can see how long it took to upload the image to WordPressstartTime: performance.now()
when adding an item to the queueOn the frontend
<img>
tags to expose collected information (file size savings, original mime type, etc.) for HTTP Archive purposes.