Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
r"
(\v)
"
Input 1
line one⋮ line twoimport { CustomCacheKey } from '@layer0/core/router' router.get('/some/path', ({ cache }) => { cache({ key: new CustomCacheKey().addCookie('language').addCookie('currency'), // Other options... }) })import { CustomCacheKey } from '@layer0/core/router' router.get('/some/path', ({ cache }) => { cache({ browser: { // Sets the cache-control: maxage=n header sent to the browser. To prevent the browser from caching this route // set maxAgeSeconds: 0 maxAgeSeconds: 0, // Sends a non-standard header `x-sw-cache-control: n` that you can use to control caching your service worker. // Note that service workers do not understand this header by default, so you would need to add code to your service // worker to support it serviceWorkerSeconds: 60 * 60, }, edge: { // Sets the TTL for a response in Layer0's edge cache maxAgeSeconds: 60 * 60 * 24, // Sets the amount of t
Extraction
line one⋮ line twoimport { CustomCacheKey } from '@layer0/core/router' router.get('/some/path', ({ cache }) => { cache({ key: new CustomCacheKey().addCookie('language').addCookie('currency'), // Other options... }) })import { CustomCacheKey } from '@layer0/core/router' router.get('/some/path', ({ cache }) => { cache({ browser: { // Sets the cache-control: maxage=n header sent to the browser. To prevent the browser from caching this route // set maxAgeSeconds: 0 maxAgeSeconds: 0, // Sends a non-standard header `x-sw-cache-control: n` that you can use to control caching your service worker. // Note that service workers do not understand this header by default, so you would need to add code to your service // worker to support it serviceWorkerSeconds: 60 * 60, }, edge: { // Sets the TTL for a response in Layer0's edge cache maxAgeSeconds: 60 * 60 * 24, // Sets the amount of t