module CQL::Cache::Middleware

Overview

Middleware helpers for integrating per-request query caching with various web frameworks

Defined in:

cache/middleware.cr

Constant Summary

VALID_REQUEST_ID = /\A[A-Za-z0-9._-]{1,128}\z/

A client-supplied request id is kept only when it matches this: 1 to 128 ASCII letters, digits, ., _ or -.

Class Method Summary

Class Method Detail

def self.trusted_request_id(request_id : String | Nil) : String | Nil #

request_id when it is valid, else a random 16-character hex id; nil stays nil (the tracker then picks one).


[View source]