Uncategorized

  • Certificates that renew themselves

    Free certificates went GA this month. Automating issuance and renewal, the rate limits that catch staging first, and the monitoring that has to outlive the automation.

  • Keyspace notifications are not a queue

    Redis can publish an event when a key is set, expired or deleted, which looks like a way to trigger work — a session expiring firing a cleanup,…

  • try_files with a named location for the fallback

    The usual front-controller line repeats the PHP handler configuration, because the fallback has to be a URI and the PHP location has its own fastcgi_pass block. A named…

  • A test double for the clock, and one for randomness

    Two things make a test unrepeatable, and both are usually called directly from the code under test: the current time and a random number. Neither can be asserted…

  • Deleting in batches keeps replication caught up

    A single DELETE removing two million rows holds locks for the duration, generates one enormous transaction in the binary log, and a replica applying it single-threadedly falls behind…

  • wp_cache_add refuses to overwrite; wp_cache_set does not

    The two look interchangeable and differ on whether the key already exists: set() overwrites unconditionally, add() fails and returns false. That failure is the useful part. With a…

  • Turning revisions off for one post type

    WP_POST_REVISIONS is a constant, so it applies to the whole site. A catalogue whose products are updated by a nightly import does not want a revision per product…

  • Finding the 200 milliseconds nobody could account for

    The page took 340ms and the parts added up to 140. Measuring from the first byte nginx sees rather than from the framework boot, and what was hiding…

  • The null coalescing operator replaces the isset ternary

    Reading a possibly-absent array key has meant naming the expression twice — once in isset(), once as the value — which is fine until the expression is $config[‘db’][‘replicas’][0]…

  • A TypeError is something you can now catch

    Passing a string where an object was hinted used to be a recoverable fatal, which in practice meant an unrecoverable one. It is an exception now, which makes…