Closed brianmcmichael closed 7 years ago
When using the Active Jobs app from Chrome, the request headers sent include:
Accept-Encoding:gzip, deflate, sdch, br
and the response headers include:
Content-Encoding:gzip
I don't think we will beat gzip.
You are right. The raw text is currently at 834 KB
, but Chome says the download size is 37.2 KB
, so it appears that the magic is already happening. Closing.
FWIW on the "Timing" tab on the ajax request in Chrome dev tools I see this:
So the question there would be, where in the request is the most of the 2.20 seconds spent? https://www.skylight.io/ for Rails apps is amazing, but there are plenty of profiling options available.
Ok, the ajax request from datatables isn't fired until after $(document).ready()
, so there's a good chance we're waiting for all of the other page components to load.
Nevermind, TTFB means we're waiting on the serverside. Got it.
Actually not sure about that.
See:
we have 2 requests we respond slowly to:
The rest of the requests total take half a second.
A json response currently looks like:
By encoding these keys to a single char we can decrease the size of the response by 30% and speed up the wait while jobs download and parse, we could probably get a better than 30% speed improvement when you compound clientside processing. This would be a valuable UX improvement because there is a longish wait time when requesting "All Jobs"
The big downfall is that the code would be a little more difficult to read, which could be overcome by appropriate inline documentation and renaming them back to more user-friendly options once they arrive at client-side.