Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Calculadora

0

59
Vistas
Cloudflare Workers: Wildcard subdomain cache manipulation issue

--This question is for cloudflare workers--

have a worker with two routes: *.example.com* example.com/app

When I attempt to manipulate the cache of foo.example.com/bar from a wildcard subdomain, there are no errors. However, when I manipulate/get the cache of foo.example.com/bar from example.com/app, undefined is returned

My code looks something like this:

addEventListener("fetch", event => {
  event.respondWith(handleRequest(event.request))
})

async function handleRequest(request) {
  const cache = caches.default;
  return new Response("cache: " + await cache.match('https://foo.exapmle.com/bar')) 
}

what is wrong?

6 months ago · Santiago Gelvez
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar empleo Planes Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2023 PeakU Inc. All Rights Reserved.