Skip to content

Commit a4db3e4

Browse files
committed
Bypass cache for origin
1 parent 725de66 commit a4db3e4

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

examples/v7-edge-functions/functions/general/signed-request/main.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ import HmacSHA1 from 'crypto-js/hmac-sha1';
33
import Base64 from 'crypto-js/enc-base64';
44
import createFetchForOrigin from '../../../utils/createFetchForOrigin';
55

6-
const fetch = createFetchForOrigin('echo');
6+
const fetch = createFetchForOrigin('echo', {
7+
edgio: {
8+
caching: {
9+
bypass_cache: true,
10+
},
11+
},
12+
});
713

814
export async function handleHttpRequest(request, context) {
915
// ** IMPORTANT **

examples/v7-edge-functions/utils/createFetchForOrigin.ts

+4
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,13 @@ export default function createFetchWithOrigin(originName: string) {
1313
}
1414

1515
return async (url: string | Request, options: any = {}) => {
16+
const edgio = options.edgio || {};
17+
delete options.edgio;
18+
1619
const modifiedOptions = {
1720
...options,
1821
edgio: {
22+
...edgio,
1923
origin: originName,
2024
},
2125
};

0 commit comments

Comments
 (0)