File tree Expand file tree Collapse file tree 5 files changed +5
-5
lines changed
documentation/docs/fastly:cache/SimpleCache Expand file tree Collapse file tree 5 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ import { SimpleCache } from 'fastly:cache';
24
24
addEventListener('fetch', event => event.respondWith(app(event)));
25
25
26
26
async function app(event) {
27
- const url = new URL(event.request);
27
+ const url = new URL(event.request.url );
28
28
const path = url.pathname;
29
29
if (url.searchParams.has('delete')) {
30
30
- SimpleCache.delete(path);
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ import { SimpleCache } from 'fastly:cache';
23
23
addEventListener (' fetch' , event => event .respondWith (app (event )));
24
24
25
25
async function app (event ) {
26
- const path = new URL (event .request ).pathname ;
26
+ const path = new URL (event .request . url ).pathname ;
27
27
let page = SimpleCache .getOrSet (path, async () => {
28
28
return {
29
29
value: await render (path),
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ import { SimpleCache } from 'fastly:cache';
57
57
addEventListener (' fetch' , event => event .respondWith (app (event )));
58
58
59
59
async function app (event ) {
60
- const path = new URL (event .request ).pathname ;
60
+ const path = new URL (event .request . url ).pathname ;
61
61
let page = SimpleCache .getOrSet (path, async () => {
62
62
return {
63
63
value: await render (path),
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ import { SimpleCache } from 'fastly:cache';
51
51
addEventListener (' fetch' , event => event .respondWith (app (event )));
52
52
53
53
async function app (event ) {
54
- const url = new URL (event .request );
54
+ const url = new URL (event .request . url );
55
55
const path = url .pathname ;
56
56
if (url .searchParams .has (' purge' )) {
57
57
SimpleCache .purge (path, { scope: " global" });
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ import { SimpleCache } from 'fastly:cache';
54
54
addEventListener (' fetch' , event => event .respondWith (app (event )));
55
55
56
56
async function app (event ) {
57
- const path = new URL (event .request ).pathname ;
57
+ const path = new URL (event .request . url ).pathname ;
58
58
let page = SimpleCache .get (path);
59
59
if (! page) {
60
60
page = await render (path);
You can’t perform that action at this time.
0 commit comments