AES Encryption Explained: How It Works and Why It Matters
Jun 23, 2026
4xx Client Error
The 428 (Precondition Required) status code indicates that the origin server requires the request to be conditional. This helps prevent the "lost update" problem where a client overwrites another client's changes without being aware of them. Clients should include a precondition header like If-Match or If-Unmodified-Since.
When building a collaborative document editor, require all update requests to include an If-Match header with the document's current ETag. If the header is missing, return 428 Precondition Required to remind the client to fetch the latest version first.
// Laravel - requiring If-Match header
if (! $request->header('If-Match')) {
return response()->json([
'error' => 'Precondition required',
'message' => 'Include If-Match header with current resource ETag',
], 428);
}
Mistake: Using 428 when the client did provide preconditions but they failed
Fix: If the client provided conditional headers but they evaluated to false, use 412 Precondition Failed. Use 428 only when the conditional headers are completely missing.
Blog
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026
Jun 23, 2026