performance

  • nginx map is a lookup table, not a conditional

    if inside a location is famously unreliable, and most uses of it are really a lookup — this value maps to that value — which map expresses directly…

  • Container memory limits and the OOM killer

    A container without a memory limit can take the host down. A container with one gets its process killed by the kernel, which from inside looks like the…

  • HTTP/2 in nginx needs TLS and a recent build

    HTTP/2 does not require encryption in the specification and does in every browser, so in practice it arrives with the certificate. nginx 1.9.5 replaced the SPDY module with…

  • OCSP stapling removes a round trip from the handshake

    Without stapling, the browser checks whether a certificate has been revoked by contacting the issuing authority itself — an extra DNS lookup and request, to a third party,…

  • IntersectionObserver replaces the scroll listener

    Detecting whether an element is on screen has meant a scroll handler calling getBoundingClientRect(), which forces a synchronous layout on every scroll event and is the classic cause…

  • Redis beyond caching: locks, counters and rate limits

    The cache server was already there doing one job out of four. A lock that expires, a release that checks it still owns the lock, and a sliding-window…

  • yield from delegates without a loop

    Composing generators without yield from means a wrapper loop that yields each item from the inner one, which works and costs a function frame per item on top…

  • Enable gzip for JSON responses in nginx

  • Time to first byte is not the number a user feels

    TTFB measures how long the server took to start responding, which is the part a backend engineer controls and a small fraction of what the visitor experiences. A…

  • A load test that reuses one connection measures nothing

    A benchmark hammering one keep-alive connection with a single URL measures the fastest path through the system with every cache warm — which is a real number about…