discourse/lib/middleware
Régis Hanol c668871f46
FEATURE: Add native support for /llms.txt (#36939)
Adds the ability to serve a custom llms.txt file at /llms.txt, allowing
site admins to provide information for LLM crawlers about the site's
structure and important content.

The implementation uses a new `llms_txt` upload site setting where
admins can upload a .txt or .md file (max 512KB). The file is served via the
StaticController, following the same pattern as favicon.

For external storage (S3), the content is cached in Redis using the
upload's SHA1 as the cache key - this means the cache automatically
invalidates when a new file is uploaded. For local storage, the file
is served directly via send_file.

Blocked crawlers are allowed to access /llms.txt, similar to robots.txt.

Ref - t/162690
Requires - https://github.com/discourse/discourse/pull/36939
2026-01-20 08:53:20 +01:00
..
anonymous_cache.rb FEATURE: Add native support for /llms.txt (#36939) 2026-01-20 08:53:20 +01:00
crawler_hooks.rb DEV: Check for setting prior to applying transformation on crawler view (#34478) 2025-08-22 14:17:45 +08:00
csp_script_nonce_injector.rb DEV: Memoize CSP nonce placeholder on response (#25724) 2024-02-16 12:15:55 +00:00
default_headers.rb DEV: ensure Rails application default headers are present in responses (#31619) 2025-03-05 13:19:09 +08:00
discourse_public_exceptions.rb SECURITY: Error responses missing Cache-Control header 2025-10-28 14:40:41 +08:00
enforce_hostname.rb DEV: Simplify CORS logic for public asset routes (#33106) 2025-06-09 08:58:27 +01:00
missing_avatars.rb DEV: Prefer \A and \z over ^ and $ in regexes (#19936) 2023-01-20 12:52:49 -06:00
omniauth_bypass_middleware.rb FIX: 'destination_url' cookie handling (#33072) 2025-08-06 10:09:01 +02:00
overload_protections.rb PERF: Reject anonymous requests with 503 upon aggressive queuing (#36519) 2025-12-18 10:23:42 +08:00
processing_request.rb PERF: Reject anonymous requests with 503 upon aggressive queuing (#36519) 2025-12-18 10:23:42 +08:00
request_tracker.rb DEV: Add feature flag for browser pageview events (#36986) 2026-01-07 15:16:18 +08:00