Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

139
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!