Code Monkey home page Code Monkey logo

Comments (6)

tdurieux avatar tdurieux commented on August 20, 2024

It's maybe better to check if the client accepts "gzipped" response.

from bluelatex.

satabin avatar satabin commented on August 20, 2024

actually the web server automatically gzips the response if you send a request with header Accept-Encoding containing gzip and if the Content-Type can be gzipped. In our case it is a bit different. SyncTeX generates a .gz file which is simply returned as is. I didn't expect your web browser to automatically gunzip it.

If you prefer, I can make the server extract the text file and return it, and let the http server gzip it (again…) if the client send the right Accept-Encoding. But that's a lot of unneeded overhead (gunzip + gzip).
Can't you gunzip directly in js? What woul be your preferred solution? How huge can become the SyncTeX file? I guess for big files, it is really huge, isn't it?

from bluelatex.

tdurieux avatar tdurieux commented on August 20, 2024

Yes SyncTex fiel can be very huge...

talk.setHeader("Content-Encoding", "gzip")
            .setContentType("text/plain")
            .setContentLength(array.length)
            .write(array)

With these lines my browser (firefox, chrome and safari) gunzip correctly the file. It is easy and powerful but it's a hack...

I can gunzip with js but it's slow.

I had also this conversation with @monperrus. We concluded that is not a to bad idea to use the http client to ungzip the file.

from bluelatex.

satabin avatar satabin commented on August 20, 2024

You don't need to handle it manually, tiscaf (our http server) makes it for you if the browser send the right header. This way it is no hack. What browser don't support gzipped content?

from bluelatex.

satabin avatar satabin commented on August 20, 2024

I don't remember the status of this ticket. Can it be closed?

from bluelatex.

tdurieux avatar tdurieux commented on August 20, 2024

We can close it.

from bluelatex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.