V
V
VisualIdeas2019-08-01 18:41:38
JavaScript
VisualIdeas, 2019-08-01 18:41:38

How to read a server-compressed file (not JS/CSS) in a browser?

The site displays road route data on a map.
You want to store waypoints (a lot of waypoints) as separate files on the server...
When you open the page, the data on the waypoints is loaded from a file and everything is great!
But the file weighs 1 MB - it's a bit fat, I want to compress ...
The json file format I
want to compress these files when saving to the server immediately with a zip and give them compressed (I don't use any nginx and other compressions), and on the client side (in the browser) already process .
There are a lot of files, they are generated automatically but 1 time (and you can immediately compress)
How to organize this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xmoonlight, 2019-08-01
@xmoonlight

Zip.js

When you open the page, the data on the waypoints is loaded from the file and everything is super!
But the file weighs 1 MB - fat, I want to compress ...
json file format
Optimize for corners over 10 degrees - have you tried it? (remove waypoints)

R
Roman Mirilaczvili, 2019-08-01
@2ord

Line Generalization - reduction of route nodes.
It is better to store directly in the DBMS after pre-processing. blog.programster.org/mysql-gis-cheatsheet
I need to write a backend web application that calls the DBMS and returns a JSON response. It is desirable to use server-side compression, such as Deflate, Gzip. It's in the HTTP Content-Encoding header.
On the client side, use some library for rendering to canvas / SVG.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question