Sending large KB string of data from server to client - make string smaller size and still use in JS

I have a Asp.net MVC app which sends a float array data to the client

float[320,240]
See attached for the data, its around 1.4mb

I need to dramatically reduce this size, and be able to convert it to the current format in Javascript

Here is the request
 $.ajax({
  type: "POST",
  url: "@Url.Action("CameraChange", "Home")",
  async:true,
  data: "{'cameraId':'" + ID + "'}",
  contentType: "application/json; charset=utf-8",
  dataType: "json",
  success: function (response) {
                 imageTemperatureDataArray = JSON.parse(response.TemperatureDataArray);
  },
   error: function (e) {
       alert("error: " + e.message + ' ');
  }
 });

Open in new window


Then I use it futher down in
 
  $("img#schemesImageSchemes").mousemove(function (e) {
       $('#dataSchemes').text(imageTemperatureDataArray[myX][myY]);
});

Open in new window


Is there a way to reduce this size of the attached
And how would i then convert it in JS ?
floattemparray.txt
websssCEOAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Shaun VermaakTechnical SpecialistCommented:
Do you have control over the MVC app and the application running on the client?

You can GZip or something like msgpack
https://msgpack.org/
websssCEOAuthor Commented:
Yes, it's one app
When I say client I mean client side /javascript end
leakim971PluritechnicianCommented:
you can use the compression at the webserver side level.
here a random link :
http://dotnetmentors.com/aspnet/how-to-enable-http-compression-in-asp-net-website.aspx

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Your Guide to Achieving IT Business Success

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

Scott FellDeveloper & EE ModeratorCommented:
Is the data coming from a database or a text file? If you are trying to solve a speed problem are you sure the issue is not with the db?  Caching the file as a text file if possible or paging chunks of data via ajax.
websssCEOAuthor Commented:
Thanks
Its coming from a file, Dev tool bar shows me 1.4mb of content download.
websssCEOAuthor Commented:
Compression is already on
And in chrome Dev tool bar is see gzip accept parameter in header
Its still showing same size on content download as the actual file size
leakim971PluritechnicianCommented:
On the chrome dev tools, go on the network tab, check "Disable cache" and if needed "Preserve log", launch your code to download the file, and check the size column for the ajax call line. If you see only one line (1.4MB), that mean your IIS server did not compressed your file. If you see two lines, 1 with the compressed size and the other 1.4MB, you're ok.
If not OK, you need to add the mime type application/json
websssCEOAuthor Commented:
thanks, i've got this in my config
    <urlCompression doDynamicCompression="true"  doStaticCompression="true" />
    <httpCompression>
      <dynamicTypes>
        <add mimeType="application/json" enabled="true" />
        <add mimeType="application/json; charset=utf-8" enabled="true" />
      </dynamicTypes>
      <staticTypes>
        <add mimeType="application/json" enabled="true" />
        <add mimeType="application/json; charset=utf-8" enabled="true" />
      </staticTypes>
    </httpCompression>


this is request headers
Accept: application/json, text/javascript, */*; q=0.01
Accept-Encoding: gzip, deflate
Accept-Language: en-GB,en-US;q=0.9,en;q=0.8
Connection: keep-alive
Content-Length: 17
Content-Type: application/json; charset=UTF-8
Host: ommited
Origin: http://ommited
Referer: http://ommited
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36
X-Requested-With: XMLHttpRequest

Open in new window



and this in response headers
Cache-Control: private
Content-Length: 1489534
Content-Type: application/json; charset=utf-8
Date: Tue, 21 May 2019 13:43:28 GMT
Server: Microsoft-IIS/10.0
X-AspNet-Version: 4.0.30319
X-AspNetMvc-Version: 5.2
X-Powered-By: ASP.NET

Open in new window


But its still 1.4mb even if i do the dev tool bar trick
leakim971PluritechnicianCommented:
so you see one line here instead 2 like 125KB and 1.4MB :

arrow.jpg
websssCEOAuthor Commented:
Yes just one line

devtools

After disabling cache
with cache off
websssCEOAuthor Commented:
ohh IIS didn't have dynamic compression installed (despite it letting me tick that box in IIS)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.