Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

138
Vistas
Static file on static folder not cached

enter image description here

I'm using sveltekit and trying to load static assets like css/js on my localhost, but it didn't cached like disk cache or memory cache, how can I resolve this? it should be cached by default right?

...
<link rel="stylesheet" href="/assets/css/open-iconic-bootstrap.min.css">
...

I already deploy it to vercel and still doesn't cached, I need help.

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

This is already using the cache, however it is being revalidated every time.

You can see from the response 304 (Not Modified) and the transmitted size (113 bytes) that the resource is not re-transmitted.

How caching of static files is handled in the end depends on the adapter being used and the deployment environment. E.g. with Node the mechanism for setting additional caching headers would be different from the mechanism for an Nginx file server.

For Vercel, you might want to read its article on caching. However, revalidating every time might not be a bad idea, that way you will not get stale data at least.

about 4 years ago · Juan Pablo Isaza Denunciar

0

For Vercel, I create another configuration by creating vercel.json in my root folder :

{
  "headers": [
    {
      "source": "/:path*",
      "headers" : [
        {
          "key" : "Cache-Control",
          "value" : "max-age=2592000, s-maxage=10"
        }
      ]
    }
  ]
}

https://vercel.com/docs/project-configuration#project-configuration/headers

"source": "/:path*",

means wildcard that matches all routes.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda