Skip to content

Commit 88b44ae

Browse files
authored
test: remove or simplify unreliable CDN caching e2e tests (#563)
* test: remove on-demand revalidation e2e tests These are absolutely not worth their maintenance cost. I've had enough. * test: skip test for broken behaviour * test: simplify cached response e2e tests These are unreliable as written, and simply not worth their maintenance cost.
1 parent b24ced1 commit 88b44ae

File tree

12 files changed

+51
-396
lines changed

12 files changed

+51
-396
lines changed

tests/e2e/fixtures/edge-site/app/routes/stale-while-revalidate.tsx renamed to tests/e2e/fixtures/edge-site/app/routes/cacheable.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ export const loader = () => {
88
},
99
{
1010
headers: {
11-
"CDN-Cache-Control":
12-
"public, max-age=60, stale-while-revalidate=31536000",
13-
"Cache-Tag": "stale-while-revalidate-tag",
11+
"CDN-Cache-Control": "public, max-age=60",
1412
},
1513
},
1614
);
@@ -24,7 +22,7 @@ export default function SWRDemo() {
2422
const { message } = useLoaderData<typeof loader>();
2523
return (
2624
<div style={{ fontFamily: "system-ui, sans-serif", lineHeight: "1.4" }}>
27-
<h1>Stale-while-revalidate</h1>
25+
<h1>Cacheable</h1>
2826
<p>{message}</p>
2927
</div>
3028
);

tests/e2e/fixtures/edge-site/app/routes/cached-for-a-year.tsx

Lines changed: 0 additions & 30 deletions
This file was deleted.

tests/e2e/fixtures/edge-site/netlify/functions/purge-cdn.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

tests/e2e/fixtures/react-router-serverless-site/app/routes.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ export default [
44
index('routes/home.tsx'),
55
route('about', 'routes/about.tsx'),
66
route('blobs', 'routes/blobs.tsx'),
7-
route('cached-for-a-year', 'routes/cached-for-a-year.tsx'),
7+
route('cacheable', 'routes/cacheable.tsx'),
88
route('context', 'routes/context.tsx'),
99
route('headers', 'routes/headers.tsx'),
1010
route('images', 'routes/images.tsx'),
1111
route('middleware-header', 'routes/middleware-header.tsx'),
12-
route('stale-while-revalidate', 'routes/stale-while-revalidate.tsx'),
1312
] satisfies RouteConfig
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ export const loader = () => {
77
},
88
{
99
headers: {
10-
'CDN-Cache-Control': 'public, max-age=60, stale-while-revalidate=31536000, durable',
11-
'Cache-Tag': 'stale-while-revalidate-tag',
10+
'CDN-Cache-Control': 'public, max-age=60, durable',
1211
},
1312
},
1413
)
@@ -22,7 +21,7 @@ export default function SWRDemo() {
2221
const { message } = useLoaderData<typeof loader>()
2322
return (
2423
<div style={{ fontFamily: 'system-ui, sans-serif', lineHeight: '1.4' }}>
25-
<h1>Stale-while-revalidate</h1>
24+
<h1>Cacheable</h1>
2625
<p>{message}</p>
2726
</div>
2827
)

tests/e2e/fixtures/react-router-serverless-site/app/routes/cached-for-a-year.tsx

Lines changed: 0 additions & 29 deletions
This file was deleted.

tests/e2e/fixtures/react-router-serverless-site/netlify/functions/purge-cdn.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

tests/e2e/fixtures/serverless-site/app/routes/stale-while-revalidate.tsx renamed to tests/e2e/fixtures/serverless-site/app/routes/cacheable.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ export const loader = () => {
88
},
99
{
1010
headers: {
11-
"CDN-Cache-Control":
12-
"public, max-age=60, stale-while-revalidate=31536000, durable",
13-
"Cache-Tag": "stale-while-revalidate-tag",
11+
"CDN-Cache-Control": "public, max-age=60, durable",
1412
},
1513
},
1614
);
@@ -24,7 +22,7 @@ export default function SWRDemo() {
2422
const { message } = useLoaderData<typeof loader>();
2523
return (
2624
<div style={{ fontFamily: "system-ui, sans-serif", lineHeight: "1.4" }}>
27-
<h1>Stale-while-revalidate</h1>
25+
<h1>Cacheable</h1>
2826
<p>{message}</p>
2927
</div>
3028
);

tests/e2e/fixtures/serverless-site/app/routes/cached-for-a-year.tsx

Lines changed: 0 additions & 30 deletions
This file was deleted.

tests/e2e/fixtures/serverless-site/netlify/functions/purge-cdn.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)