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