From 54086784a03780187111f50855f847942c7f782b Mon Sep 17 00:00:00 2001 From: Wes Bos Date: Thu, 23 Feb 2023 10:45:43 -0500 Subject: [PATCH] try content-visibility: auto --- package.json | 2 +- src/entry.server.tsx | 5 +---- src/styles.css | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 10e918eb..85146127 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ }, "scripts": { "build": "netlify build", - "dev": "NODE_ENV=development remix dev" + "dev": "NODE_ENV=development netlify dev" }, "devDependencies": { "@types/styled-components": "^5.1.26", diff --git a/src/entry.server.tsx b/src/entry.server.tsx index e156225d..3057995f 100644 --- a/src/entry.server.tsx +++ b/src/entry.server.tsx @@ -32,8 +32,7 @@ export default async function handleRequest( ) { // check if we have a cached response in memory const cachedResponse = cache.get(request.url); - const isBuildUrl = request.url.includes('/build/'); - if (cachedResponse && !isBuildUrl) { + if (cachedResponse) { // console.log('Serving from cache', request.url); // if we have a cached response, check if it's less than 5 seconds old const now = new Date(); @@ -64,7 +63,6 @@ export default async function handleRequest( // tee the stream so we can cache it and send it to the client const [toReponse, toCache] = body.tee(); - if (!isBuildUrl) { streamToText(toCache).then(html => { console.log('Caching', request.url); cache.set(request.url, { @@ -72,7 +70,6 @@ export default async function handleRequest( date: new Date(), }); }); - } const headers = new Headers(responseHeaders); headers.set("Content-Type", "text/html"); diff --git a/src/styles.css b/src/styles.css index 43af3430..9c3e4d07 100644 --- a/src/styles.css +++ b/src/styles.css @@ -97,8 +97,8 @@ body::-webkit-scrollbar-thumb { grid-template-rows: 1fr auto auto; } -.PersonWrapper:nth-child(5) { - background: green; +.PersonWrapper:nth-child(6n) ~ .PersonWrapper { + content-visibility: auto; } .PersonInner {