Imgur is the most popular platform for browsing and sharing user-curated images online. With mobile and desktop apps for generating memes and more than 1.5 million images uploaded daily, Imgur has grown into one of the most heavily trafficked websites in the world, boasting more than 130 million global users and 5 billion monthly pageviews.
Because of Imgur’s popularity, they need to quickly serve billions of images without straining their origin servers. They came to Fastly while searching for a content delivery network (CDN) that could integrate with their stack and act as an extension of their application. The Imgur team also uses Varnish, the state-of-the-art web accelerator designed for dynamic content (such as websites, APIs, and mobile applications) on which Fastly was built. They were excited about deploying custom Varnish configurations to the edge of a CDN network.
Flexibility in configuration
Imgur sought a content delivery network that could provide the same flexibility and transparency that they have with their own stack. Fastly is currently the only CDN that uses Varnish, which gives customers complete control over their service, including the ability to make and deploy configuration changes instantly without having to go through customer support or professional services.
The ability to self-serve on Fastly is crucial for companies like Imgur that ship new code daily and value speed of innovation. Using either Fastly’s app or API, Imgur can customize their caching logic to match their needs in real time. This allows them to easily integrate Fastly into their team’s development cycle and gives them the control they need to feel confident.

API caching for mobile acceleration
Imgur believes in caching everything. With Fastly, they’re able to cache dynamic content, like API calls, as well as static content, like the hundreds of millions of images on their site. Imgur caches every API call for users who aren’t logged in for 60 seconds, allowing them to quickly serve content that’s the same for all users directly from the edge. When visitors log in, the API calls are cached for 1 second. With the help of Fastly, Imgur’s API easily serves 8,000 requests per second.
Caching their API with Fastly also improves Imgur’s mobile performance, which accounts for 40% of total traffic. Imgur’s mobile site is mostly static content comprised of an HTML file and Javascript files. These static objects are served from Fastly, and the dynamic aspect is served from the API, which Fastly also caches. This enables Imgur to provide mobile users with a snappy experience while simultaneously reducing requests to origin.
With the ability to cache both static and dynamic elements of their site, Imgur has improved performance for end users. More content is served directly from the edge, geographically closest to end users, and the number of requests to origin has decreased, lessening the strain on Imgur’s infrastructure.
Pushing Varnish to the edge
Before moving to Fastly, the Imgur team was running their own Varnish servers. Because Fastly is built on Varnish software, Imgur was able to move their custom Varnish configurations from their own Varnish servers to Fastly’s globally distributed edge servers, giving the team greater reach and increased control over logic at the edge. Custom VCL enables Imgur to generate the thumbnails associated with user-uploaded images on the fly and cache them with a singular URL, reducing load on origin while speeding up delivery.
Unprecedented visibility
With Fastly, Imgur gains unprecedented visibility into their site’s performance. Fastly’s real-time analytics and historical stats dashboards allow Imgur to watch their cache-hit ratio, requests per second, and error rate, monitoring their site performance in real time.