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

112
Views
HTTP-caching long search requests?

I seek for a solution to request a resource identified by possibly a long string (>8k) and let browser/proxy cache the response.

It is a Chrome-extension javascript fetch() search request (thus being of unknown contents and length) that I would like to retrieve from cache next time. The same request will always yield the same response.

I know I can take care and store data in browser storage myself... but I am interested if I can do it code-less leveraging standard HTTP caching that will work also with any proxy.

The initial idea was to have a GET request with the BODY part containing a request (RFC is quite unclear and recently changed) where the URL will contain SHA1 of the BODY so next time the resource can be retrieved from cache as any normal resource. But fetch() does not allow for that and compatibility with other software is questionable.

Simply: is there a way that would achieve the following?

let body = JSON.stringify({...request});
fetch("https://example.org/search?sha1=" + sha1(body), {
    "method": "GET",
    "body": body,
    "headers": {"Content-Type": "application/json"},
    "cache": "force-cache"
})

Note: Fetch does not allow for GET/HEAD with the body.

I need a solution that will work with the following technologies: Chrome, Apache, NGINX, Cloudflare

Note: I am aware of fetch() interception: https://developers.cloudflare.com/workers/examples/cache-post-request

about 4 years ago · Juan Pablo Isaza
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!