I assume your JSON looks like this:
{
id: 42,
car_id: 102,
coordinates: [
{ lat: ..., lon: ..., timestamp: ... },
{ lat: ..., lon: ..., timestamp: ... },
{ lat: ..., lon: ..., timestamp: ... },
...
]
}
If you use JSON, the there are only 4 ways to reduce the size:
Remove unused data
You could remove duplicate entries from your list. If the car stands still for an hour, you will have 180 identical entries in a row. You could only keep a single one, because the drawn line on the map won't look different.
Remove the timestamp if you don't need it. If the array is ordered, you might not need a timestamp for sorting.
Shrink your data representation
Each character makes a difference, if you've got 4320 entries. So you could replace for example lat and lon with x and y. That reduces the size by 4*4320 = 17280 characters.
Change the representation. If you don't need the timestamp, you could simple reduce your data structure to coordinates: [[1,2],[3,4],[5,6],...] (where 1, 3 and 5 are the lat part and 2, 4, 6 are the lon part of the coordinate). This may reduce the JSON size by another 20-40%.
Compress the data
- If possible use GZIP (or any other compression algorithm). That way you can easily shrink the JSON output to 10-20% of the original size.
Use a more compact data format
Have a look at Protocol Buffers (from Google). Spring supports it and there's also a JavaScript library.
There are a few other protocols that can reduce the data size. I.e. Thrift (from Apache / Facebook), but I don't know if Spring / JavaScript supports it.
That's basically all you can do.