# What Does Your Webserver Do When a User Hits Refresh?

DevFeed: [What Does Your Webserver Do When a User Hits Refresh?](<https://devfeed.tech/articles/what-does-your-webserver-do-when-a-user-hits-refresh-1273.md>)

Original publisher: [Read original article](<https://shopify.engineering/17489012-what-does-your-webserver-do-when-a-user-hits-refresh>)

Author: Shopify Engineering

Published: 2013-03-19T15:23:00Z

Content type: article

Language: en

Sources: [Shopify Engineering](<https://devfeed.tech/sources/shopify-engineering.md>), [Shopify Engineering - Shopify Engineering](<https://devfeed.tech/sources/shopify-engineering-shopify-engineering.md>)

Topics: [nginx](<https://devfeed.tech/topics/nginx.md>), [web applications](<https://devfeed.tech/topics/web-applications.md>), [Availability](<https://devfeed.tech/topics/availability.md>), [Rails](<https://devfeed.tech/topics/rails.md>), [HTTP](<https://devfeed.tech/topics/http.md>), [Unix](<https://devfeed.tech/topics/unix.md>), [Processes](<https://devfeed.tech/topics/processes.md>)

Tags: [availability](<https://devfeed.tech/tags/availability.md>), [blog-post](<https://devfeed.tech/tags/blog-post.md>), [browser](<https://devfeed.tech/tags/browser.md>), [customer](<https://devfeed.tech/tags/customer.md>), [flash](<https://devfeed.tech/tags/flash.md>), [http](<https://devfeed.tech/tags/http.md>), [logs](<https://devfeed.tech/tags/logs.md>), [nginx](<https://devfeed.tech/tags/nginx.md>), [process](<https://devfeed.tech/tags/process.md>), [product](<https://devfeed.tech/tags/product.md>), [queue](<https://devfeed.tech/tags/queue.md>), [server](<https://devfeed.tech/tags/server.md>), [servers](<https://devfeed.tech/tags/servers.md>), [shopify](<https://devfeed.tech/tags/shopify.md>), [web](<https://devfeed.tech/tags/web.md>)

## AI overview

This Shopify Engineering article explains how refreshes during overloaded flash-sale traffic can create queues of requests that users have already abandoned. It describes a patch for the Unicorn webserver that checks whether the client is still connected before invoking the Rails application, reducing wasted rendering work. The article also explains Nginx connection queues, HTTP 499 log entries, and how these conditions can contribute to reduced availability.

## Source excerpt

Your web application is likely rendering requests when the requesting client has already disconnected. Eric Wong helped us devise a patch for the Unicorn webserver that will test the client connection before calling the application, effectively dropping disconnected requests before wasting app server rendering time. The Flash Sale A common traffic pattern we see at Shopify is the flash sale, where a product will be discounted heavily or only available for a very short period of time.