TestNew | Basic middleware initialization with key addition | Adds multiple keys (page, content) and sets Surrogate-Key header |
TestWithOptions_DefaultKeys | Default keys configuration | Automatically includes default keys (site, global) in all responses |
TestWithOptions_CustomHeader | Custom header name | Uses custom header name (xkey) instead of default Surrogate-Key |
TestGet | Retrieve Keys from context | Returns the Keys instance from context and allows manipulation |
TestAdd | Add multiple keys in handler | Adds multiple keys (key1, key2) and includes both in header |
TestClear | Clear all keys including defaults | Removes all keys, resulting in no Surrogate-Key header |
TestWithKeys | Convenience function for default keys | Creates middleware with default keys using WithKeys() helper |
TestFastly | Fastly CDN preset | Uses Surrogate-Key header with Fastly configuration |
TestVarnish | Varnish CDN preset | Uses xkey header for Varnish compatibility |
TestNoKeys | No keys added scenario | Does not set Surrogate-Key header when no keys are added |
TestKeysCleared | Keys.Clear() method | Properly clears keys from the Keys struct |