nortd / driveboardapp

Next generation Lasersaur control app.
http://www.lasersaur.com
15 stars 19 forks source link

Adding gzip compression on data send #23

Closed adammhaile closed 6 years ago

adammhaile commented 6 years ago

In general, this aids in diminishing issues seen when trying to load large files or jobs. In particular I've found this to be an issue on latest Chrome running on Windows 10 whereas with Firefox (latest) it's not an issue. Essentially, Chrome bombs out of even trying /load POST calls before it ever reaches the backend if the amount of data being sent is too large. Firefox doesn't seem to have this problem at all, but Edge/IE does though at a slightly higher size than Chrome. I've attacked this problem in a few ways:

Note: These updates were written in such a way that backwards compatibility has been maintained with the original API. I've added a new option to the user config, enable_gzip, which, if set to false, causes the application to go back to the old way of doing things. The file upload method and gzip compression are merely a secondary route by which the data can make it to the backend. But, when enabled, should allow ~10x larger files to be loaded. As it was there were some of the library jobs that couldn't even be loaded using chrome, and this update fixes that.

stefanix commented 6 years ago

Thx Adam, added to the v18.05 release.