fixing compression
This commit is contained in:
parent
f3d020b031
commit
e93779ebf7
Binary file not shown.
|
|
@ -87,8 +87,9 @@ export const createResponse = (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (opt.cache_accept.toLowerCase().includes("gz")) {
|
||||||
if (opt?.high_compression) {
|
if (opt?.high_compression) {
|
||||||
if (!cached && opt.cache_accept.toLowerCase().includes("gz")) {
|
if (!cached) {
|
||||||
const content_hash = simpleHash(content);
|
const content_hash = simpleHash(content);
|
||||||
if (!g.cache.gz[content_hash]) {
|
if (!g.cache.gz[content_hash]) {
|
||||||
g.cache.gz[content_hash] = Bun.gzipSync(content);
|
g.cache.gz[content_hash] = Bun.gzipSync(content);
|
||||||
|
|
@ -104,6 +105,7 @@ export const createResponse = (
|
||||||
headers["content-encoding"] = "gzip";
|
headers["content-encoding"] = "gzip";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let res = new Response(
|
let res = new Response(
|
||||||
content,
|
content,
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,7 @@ export const createServer = async () => {
|
||||||
const url = new URL(req.url) as URL;
|
const url = new URL(req.url) as URL;
|
||||||
url.pathname = url.pathname.replace(/\/+/g, "/");
|
url.pathname = url.pathname.replace(/\/+/g, "/");
|
||||||
|
|
||||||
|
|
||||||
const prasi = {};
|
const prasi = {};
|
||||||
const index = prodIndex(g.deploy.config.site_id, prasi);
|
const index = prodIndex(g.deploy.config.site_id, prasi);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue