Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9212881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:37:30+00:00 2026-06-18T01:37:30+00:00

Consider this scenario: The Varnish cache has a MISS and the backend server is

  • 0

Consider this scenario:
The Varnish cache has a MISS and the backend server is now regenerating the requested content. During the generation time a second request comes in and also gets an MISS. Does varnish send this request to the backend while the other request is pending? What if thousand requests come in between this time. Server would crash right? Every request would make it slower.

Is this correct or is varnish “synchronizing” those scenarios to prevent such a problem?

Thank you in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T01:37:31+00:00Added an answer on June 18, 2026 at 1:37 am

    Varnish sends all the requests to the backend. I.e. it does not queue other requests and issue just one backend request and use its response for all.

    However Varnish has a grace option that lets you keep old, expired content in cache for these types of situations.

    For example consider the following VCL:

    sub vcl_recv {
      if (req.backend.healthy) {
        set req.grace = 5m;
      } else {
        set req.grace = 24h;
      }
    }
    
    sub vcl_fetch {
       set beresp.grace = 24h;
    }
    

    Now if a backend is healthy (see backend polling) and a request results in a MISS, the first request is sent to a backend. If another request comes for the same content, but there is an item in the cache with age <TTL+req.grace (in this case 5 minutes), that request will get the “stale” content instead. This happens as long as either the first request that resulted in a MISS gets a response from the backend (and the cache is fresh again) or the age of the item becomes greater than TTL+req.grace.

    If the backend was down (req.backend.healthy == FALSE), stale content would be served as long as age<TTL+24h.

    You might also want to check out the Saving a request section of the Varnish book for a more thorough example and an exercise.

    Fixed: unescaped < character.

    Fixed more: There was another unescaped < character…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider this scenario. I have some business logic that now and then will be
Consider a scenario where a Mirth channel has one or more Destinations. In this
Database software: SQLITE Consider this scenario: Table X has attributes: A,B,C,D,1,2,3,4 Table Y needs
Consider this scenario that two WCF clients connect to one WCF service(server), this service
Consider this scenario we have a class A which is singleton it has a
Please consider this scenario: a web app that has 4 levels of access: admin
Consider this scenario: I've an XML file called person.xml with the following data in
Consider this scenario. I have my own website, that I use as my identifier,
Consider this scenario. I have an object, lets call it.... Foo. Foo raises a
Please Consider this scenario: We have a base class called clsMain : class clsMain

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.