performance

  • A CDN in front of an API needs a Vary header

    A cache keys on the URL. If the response depends on anything else — an Accept header, a language, an authorisation token — the cache will serve one…

  • The DEL that blocked the server, and UNLINK

    A 400ms pause on every request, once an hour, caused by a cache cleanup nobody thought of as expensive. Redis is single-threaded, and freeing memory is work.

  • An index that helps reads and halves your write throughput

    Every index is maintained on every insert, update and delete touching its columns, so an index added to fix one report is paid for by every write to…

  • Passive listeners are the default for some events now

    Chrome made touchstart and touchmove listeners on the document and window passive by default, which improves scrolling everywhere and silently breaks anything relying on preventDefault() there. A pull-to-refresh…

  • prestissimo, and why parallel downloads are not the default

    Composer downloads packages one at a time, which on a cold cache with sixty dependencies is mostly waiting on latency. A plugin parallelises it and the improvement is…

  • Read replicas, and the queries that must not use them

    Reads moved to a replica and checkout started showing empty carts. Read-after-write, sticky connections, and measuring the lag rather than assuming it.

  • Probabilistic early expiry beats a lock

    Rather than coordinating who recomputes, let each reader decide independently with a probability that rises as the expiry approaches — so one request refreshes early and the rest…

  • Rate limiting in nginx before it reaches PHP

    A rate limiter in the application still costs a PHP-FPM worker per request, which means a burst of login attempts occupies the pool whether or not it is…

  • Query cache is gone in 8.0, and was already a mistake

    The query cache stores result sets keyed by the exact query text and invalidates every entry for a table whenever that table is written. On anything with writes,…

  • Multi-stage builds cut the image in half

    17.05 made the two-Dockerfile trick unnecessary. Named stages, what to copy forward, and why the build cache still rewards the order of instructions.