Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Caching with Nginx. You Can Run Faster!

Caching with Nginx. You Can Run Faster!

Starting from caching concepts I will jump quickly in to available Nginx caching directives.
I will explain why they are useful and how you can profit from them.
Armored with this knowledge we will fight our way through a real world Nginx caching example.

Get the full Nginx caching tutorial on my blog: http://czerasz.com/2015/03/30/nginx-caching-tutorial/

Avatar for Michał Czeraszkiewicz

Michał Czeraszkiewicz

March 30, 2015

Other Decks in Technology

Transcript

  1. How to generate a Nginx cache hash key? echo -n

    "httpczerasz.com/time.php" | md5sum
  2. MISS Object was not found in the cache. Response was

    served from the origin. Response may have been saved to cache. BYPASS Got response from upstream. Response may have been saved to cache. EXPIRED Cached object has expired. Response was served from the upstream. STALE Object served from cache because of issues with origin server response UPDATING Serve stale content from cache because proxy_cache_lock has timed out and proxy_use_stale takes control REVALIDATED proxy_cache_revalidate verified that the current cached content was still valid HIT The object was found in the cache and it is served from there