developer-delphi-horse-etag

Compute ETag headers and return 304 responses in Horse middleware.

Updated Jan 6, 2026
One-click install
npx skills add https://github.com/cslsoftwares/ParamentersORM --skill developer-delphi-horse-etag
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: developer-delphi-horse-etag
Source: https://github.com/cslsoftwares/ParamentersORM/tree/main/.cursor/skills/developer-delphi-horse-etag_V1.0.0
Command: npx skills add https://github.com/cslsoftwares/ParamentersORM --skill developer-delphi-horse-etag

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This middleware enables conditional HTTP caching by automatically computing and applying ETag headers to responses in Horse, ensuring that clients can validate cached data and avoid unnecessary transfers.

Core Features & Use Cases

  • ETag computation: computes a hash of the response body and attaches an ETag header.
  • Not Modified support: returns 304 Not Modified when the client sends a matching If-None-Match.
  • Pipeline integration: designed to be placed after JSON serialization in the THorse pipeline, and supports Vary headers for nuanced cache invalidation.

Quick Start

Add the ETag middleware to your THorse app after the serialization step to enable conditional responses.

Frequently Asked Questions about developer-delphi-horse-etag

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enable HTTP ETag caching in a Horse web server?

To enable HTTP ETag caching in a Horse web server, add the ETag middleware to your pipeline. It computes a hash of the response body, attaches the ETag header, and returns 304 Not Modified for unchanged client requests.

What is conditional HTTP caching and when do I need an ETag middleware?

Conditional HTTP caching uses an ETag header to let clients validate cached data. You need ETag middleware when GET endpoints return stable data and you want to avoid unnecessary data transfers by returning 304 Not Modified responses.

Where should I place ETag middleware in the Horse pipeline?

You should place ETag middleware in the Horse pipeline after JSON serialization. This ensures the middleware computes the hash of the final response body and accurately sets the ETag header before the response is sent.

How does the middleware handle If-None-Match headers for unchanged data?

The middleware handles If-None-Match headers by comparing the client's value with the computed response body hash. When they match, it automatically returns a 304 Not Modified response, supporting Vary headers for nuanced cache invalidation.

Can I use ETag headers for all Horse GET endpoints or only stable data?

You should apply ETag headers only to Horse GET endpoints that return stable data. Computing hashes for highly dynamic responses adds overhead without providing meaningful caching benefits or valid 304 Not Modified responses.