revert: add compression support to frontend and backend (#3549)

Revert "feat: add compression support to frontend and backend (#3484)"

This reverts commit b63916e3c6.
This commit is contained in:
Lucas Oliveira 2024-08-26 13:24:02 -03:00 committed by GitHub
commit f4e96b113e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 1 additions and 44 deletions

View file

@ -57,7 +57,6 @@
"moment": "^2.30.1",
"openseadragon": "^4.1.1",
"p-debounce": "^4.0.0",
"pako": "^2.1.0",
"playwright": "^1.44.1",
"react": "^18.3.1",
"react-ace": "^11.0.1",
@ -12037,12 +12036,6 @@
"resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz",
"integrity": "sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw=="
},
"node_modules/pako": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz",
"integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==",
"license": "(MIT AND Zlib)"
},
"node_modules/parent-module": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",

View file

@ -52,7 +52,6 @@
"moment": "^2.30.1",
"openseadragon": "^4.1.1",
"p-debounce": "^4.0.0",
"pako": "^2.1.0",
"playwright": "^1.44.1",
"react": "^18.3.1",
"react-ace": "^11.0.1",

View file

@ -1,7 +1,6 @@
import { LANGFLOW_ACCESS_TOKEN } from "@/constants/constants";
import useAuthStore from "@/stores/authStore";
import axios, { AxiosError, AxiosInstance, AxiosRequestConfig } from "axios";
import pako from "pako";
import { useContext, useEffect } from "react";
import { Cookies } from "react-cookie";
import { BuildStatus } from "../../constants/enums";
@ -14,22 +13,6 @@ import { useLogout, useRefreshAccessToken } from "./queries/auth";
// Create a new Axios instance
const api: AxiosInstance = axios.create({
baseURL: "",
transformRequest: (axios.defaults.transformRequest
? Array.isArray(axios.defaults.transformRequest)
? axios.defaults.transformRequest
: [axios.defaults.transformRequest]
: []
).concat(function (data, headers) {
// compress strings if over 1KB
if (typeof data === "string" && data.length > 1024) {
headers["Content-Encoding"] = "gzip";
return pako.gzip(data);
} else {
// delete is slow apparently, faster to set to undefined
headers["Content-Encoding"] = undefined;
return data;
}
}),
});
const cookies = new Cookies();