From 36b1e060794b49d5ec4c811a2cd60426bf02edfd Mon Sep 17 00:00:00 2001 From: Joost de Valk Date: Wed, 25 Nov 2026 20:10:44 +0100 Subject: [PATCH 1/2] Prevent personalized Markdown from entering shared caches --- README.md | 26 ++++- readme.txt | 7 +- src/Output/CachePolicy.php | 59 ++++++++++ src/Output/ContentRenderer.php | 24 ++-- src/Router/RewriteHandler.php | 12 +- tests/bootstrap.php | 21 ++++ tests/router-request.php | 148 ++++++++++++++++++++++++ tests/run.php | 2 + tests/security.php | 205 +++++++++++++++++++++++++++++++++ 9 files changed, 479 insertions(+), 25 deletions(-) create mode 100644 src/Output/CachePolicy.php create mode 100644 tests/router-request.php create mode 100644 tests/security.php diff --git a/README.md b/README.md index f766013..755839b 100644 --- a/README.md +++ b/README.md @@ -159,7 +159,7 @@ add_filter( 'markdown_alternate_supported_post_types', function( $types ) { ### Adjust cache duration -Markdown output is cached using transients for 24 hours by default. You can change that with `markdown_alternate_cache_expiration`: +Eligible anonymous Markdown output is cached using transients for 24 hours by default. You can change that with `markdown_alternate_cache_expiration`: ```php add_filter( 'markdown_alternate_cache_expiration', function( $seconds ) { @@ -257,8 +257,17 @@ default value. Return `false` from `markdown_alternate_cache_enabled` to bypass both transient reads and writes. The filter receives the `WP_Post` as its second argument. HTTP responses also send private, no-store headers and mark the page as uncacheable. -The WooCommerce integration disables this cache for products; posts and pages -still default to cached output. +Logged-in visitors, password-protected posts, and visitors carrying WordPress +post-password, WooCommerce session/cart, or Easy Digital Downloads cart cookies +always bypass shared caching. The filter cannot turn caching back on for them. +The WooCommerce integration also disables caching for all products. Other +anonymous requests still use the shared cache; use this filter for custom +sessions or other visitor-dependent output. + +Markdown response handlers run at `template_redirect` priority 15, after the +default-priority access checks and canonical redirects. Explicit `.md` URLs +still skip canonical redirects; `?format=markdown` and Accept-negotiated requests +can be normalized first. Access checks on this hook must run before priority 15. ### Invalidate integration data @@ -275,15 +284,20 @@ add_filter( 'markdown_alternate_cache_version', function( $version, $post ) { Append your token to the existing value so multiple integrations can participate. The token is stored with the cached document; it does not change the transient key. -Old cache entries without a version token are regenerated once. Cache duration -continues to use `markdown_alternate_cache_expiration`. +Old cache entries without the current cache schema are regenerated once, even +when an integration's version token still matches, so previously cached personal +output is not reused. Cache duration continues to use +`markdown_alternate_cache_expiration`. ### Run renderer regression tests Run `php tests/run.php` after installing dependencies. These standalone tests use WordPress API doubles and the real Markdown converter, and compare default output with fixtures captured from `main` at commit `7afba03`. CI runs them on PHP 7.4–8.3; -they do not replace a full WordPress integration test. +they do not replace a full WordPress integration test. The suite also checks +visitor isolation, old-cache invalidation, private response headers, access-check +ordering, and canonical redirects. Router cases run in child PHP processes so +the real handlers can terminate their responses normally. ### Run WooCommerce integration tests diff --git a/readme.txt b/readme.txt index 6f31e21..ed5e1f6 100644 --- a/readme.txt +++ b/readme.txt @@ -86,7 +86,7 @@ Example: = Is the output cached? = -Yes. Markdown output is cached using WordPress transients for 24 hours by default. The cache is automatically bypassed if the post has changed. Developers can adjust the cache duration with the `markdown_alternate_cache_expiration` filter. +Yes. Eligible anonymous Markdown output is cached using WordPress transients for 24 hours by default. Logged-in visitors, password-protected posts, and visitors with known session or cart cookies bypass shared caching and receive private, no-store responses. Old cache entries are regenerated after the cache-isolation fix. The cache is also regenerated if the post has changed. Developers can adjust the duration with `markdown_alternate_cache_expiration` and disable caching for custom visitor-dependent output with `markdown_alternate_cache_enabled`. = What does the Markdown output include? = @@ -102,6 +102,11 @@ Yes, as an opt-in. With `add_filter( 'markdown_alternate_skip_noindexed', '__ret == Changelog == += Unreleased = +* Prevented visitor-specific Markdown from entering shared caches and invalidated previously generated entries +* Moved Markdown response handlers after default-priority access checks and canonical redirects +* Added cache-isolation, response-header, and routing-order regression tests + = 1.2.0 = * Added WooCommerce product metadata, formatted prices, short descriptions, visible attributes, and variations * Bypassed shared and HTTP caching for customer-dependent product output diff --git a/src/Output/CachePolicy.php b/src/Output/CachePolicy.php new file mode 100644 index 0000000..bc7e16b --- /dev/null +++ b/src/Output/CachePolicy.php @@ -0,0 +1,59 @@ +post_password ) { + return false; + } + + // Guest sessions can personalize ordinary posts and pages too. + $session_cookies = array( + 'wp-postpass_', + 'wp_woocommerce_session_', + 'woocommerce_items_in_cart', + 'woocommerce_cart_hash', + 'edd_items_in_cart', + ); + foreach ( array_keys( $_COOKIE ) as $name ) { + foreach ( $session_cookies as $prefix ) { + if ( 0 === strpos( (string) $name, $prefix ) ) { + return false; + } + } + } + + /** + * Filters whether otherwise eligible output can use shared caching. + * + * Disable for custom sessions or other visitor-dependent content. + * The HTTP router also uses this to send private, no-store headers. + * Logged-in visitors, password-protected posts and known session + * cookies always bypass caching, regardless of this filter. + * + * @since 1.2.0 + * + * @param bool $enabled Whether output may be cached. Default true. + * @param WP_Post $post The post being rendered. + */ + return (bool) apply_filters( 'markdown_alternate_cache_enabled', true, $post ); + } +} diff --git a/src/Output/ContentRenderer.php b/src/Output/ContentRenderer.php index d00edb5..56941f7 100644 --- a/src/Output/ContentRenderer.php +++ b/src/Output/ContentRenderer.php @@ -20,6 +20,13 @@ */ class ContentRenderer { + /** + * Cache schema; older entries may contain another visitor's output. + * + * @var int + */ + private const CACHE_SCHEMA = 1; + /** * The HTML to Markdown converter. * @@ -44,18 +51,7 @@ public function __construct() { */ public function render( WP_Post $post ): string { $transient_key = 'md_alt_cache_' . $post->ID; - /** - * Filters whether rendered output can use shared caching. - * - * Disable for content whose output depends on the current customer. - * The HTTP router also uses this to send private, no-store headers. - * - * @since 1.2.0 - * - * @param bool $enabled Whether output may be cached. Default true. - * @param WP_Post $post The post being rendered. - */ - $cache_enabled = (bool) apply_filters( 'markdown_alternate_cache_enabled', true, $post ); + $cache_enabled = CachePolicy::is_enabled( $post ); $cached_data = $cache_enabled ? get_transient( $transient_key ) : false; /** @@ -73,7 +69,8 @@ public function render( WP_Post $post ): string { $cache_version = (string) apply_filters( 'markdown_alternate_cache_version', '', $post ); if ( is_array( $cached_data ) - && isset( $cached_data['markdown'], $cached_data['modified'], $cached_data['version'] ) + && isset( $cached_data['markdown'], $cached_data['modified'], $cached_data['version'], $cached_data['schema'] ) + && self::CACHE_SCHEMA === $cached_data['schema'] && $post->post_modified === $cached_data['modified'] && $cache_version === $cached_data['version'] ) { @@ -148,6 +145,7 @@ public function render( WP_Post $post ): string { set_transient( $transient_key, array( + 'schema' => self::CACHE_SCHEMA, 'markdown' => $output, 'modified' => $post->post_modified, 'version' => $cache_version, diff --git a/src/Router/RewriteHandler.php b/src/Router/RewriteHandler.php index 9ad2813..59b384a 100644 --- a/src/Router/RewriteHandler.php +++ b/src/Router/RewriteHandler.php @@ -9,6 +9,7 @@ use WP_Post; use MarkdownAlternate\Output\ContentRenderer; +use MarkdownAlternate\Output\CachePolicy; use MarkdownAlternate\PostTypeSupport; /** @@ -42,10 +43,11 @@ public function register(): void { add_action('parse_request', [$this, 'parse_markdown_url']); // Prevent canonical redirect for .md URLs add_filter('redirect_canonical', [$this, 'prevent_markdown_redirect'], 10, 2); - // Order: format parameter -> Accept negotiation -> markdown request (URL wins first) - add_action('template_redirect', [$this, 'handle_format_parameter'], 1); - add_action('template_redirect', [$this, 'handle_accept_negotiation'], 1); - add_action('template_redirect', [$this, 'handle_markdown_request'], 1); + // Run after default-priority access checks and canonical redirects. + // Keep format -> Accept -> .md ordering; explicit .md URLs win. + add_action( 'template_redirect', array( $this, 'handle_format_parameter' ), 15 ); + add_action( 'template_redirect', array( $this, 'handle_accept_negotiation' ), 15 ); + add_action( 'template_redirect', array( $this, 'handle_markdown_request' ), 15 ); } /** @@ -236,7 +238,7 @@ private function serve_markdown_response(WP_Post $post): void { } // Keep customer-dependent output out of HTTP and WordPress page caches too. - if ( ! apply_filters( 'markdown_alternate_cache_enabled', true, $post ) ) { + if ( ! CachePolicy::is_enabled( $post ) ) { nocache_headers(); header( 'Cache-Control: private, no-store, no-cache, must-revalidate, max-age=0' ); if ( ! defined( 'DONOTCACHEPAGE' ) ) { diff --git a/tests/bootstrap.php b/tests/bootstrap.php index fcb2218..f4fd9da 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -16,6 +16,7 @@ class WP_Post { public $post_title = 'Post Title'; public $post_content = '

Hello world.

'; public $post_type = 'post'; + public $post_password = ''; } class WP_Term { @@ -32,7 +33,9 @@ class WP_Error {} define( 'DAY_IN_SECONDS', 86400 ); function md_alt_test_reset() { + $_COOKIE = array(); $GLOBALS['md_alt_test_state'] = array( + 'logged_in' => false, 'filters' => array(), 'cache' => array(), 'expiration' => array(), @@ -47,6 +50,24 @@ function md_alt_test_reset() { ); } +function is_user_logged_in() { + return $GLOBALS['md_alt_test_state']['logged_in']; +} + +function add_action( $tag, $callback, $priority = 10, $accepted_args = 1 ) { + add_filter( $tag, $callback, $priority, $accepted_args ); +} + +function do_action( $tag, ...$args ) { + $priorities = $GLOBALS['md_alt_test_state']['filters'][ $tag ] ?? array(); + ksort( $priorities ); + foreach ( $priorities as $callbacks ) { + foreach ( $callbacks as list( $callback, $accepted_args ) ) { + $callback( ...array_slice( $args, 0, $accepted_args ) ); + } + } +} + function get_post( $post ) { return $post instanceof WP_Post ? $post : ( $GLOBALS['md_alt_test_state']['posts'][ $post ] ?? null ); } diff --git a/tests/router-request.php b/tests/router-request.php new file mode 100644 index 0000000..a0a6705 --- /dev/null +++ b/tests/router-request.php @@ -0,0 +1,148 @@ +post_password = 'dummy-password'; + } elseif ( 'filter-disabled' === $md_alt_mode ) { + add_filter( + 'markdown_alternate_cache_enabled', + static function () { + return false; + } + ); + } + + ob_start(); + register_shutdown_function( + static function () { + echo json_encode( + array( + 'body' => ob_get_clean(), + 'status' => $GLOBALS['md_alt_response_status'], + 'headers' => $GLOBALS['md_alt_response_headers'], + 'cache' => $GLOBALS['md_alt_test_state']['cache'], + 'renders' => $GLOBALS['md_alt_test_state']['renders'], + 'page_cache_disabled' => defined( 'DONOTCACHEPAGE' ) && DONOTCACHEPAGE, + ) + ); + } + ); + ( new \MarkdownAlternate\Router\RewriteHandler() )->register(); + if ( 'deny10' === $md_alt_mode || 'deny14' === $md_alt_mode ) { + add_action( + 'template_redirect', + static function () { + status_header( 403 ); + echo 'Access denied'; + exit; + }, + 'deny10' === $md_alt_mode ? 10 : 14 + ); + } elseif ( 'canonical' === $md_alt_mode ) { + add_action( + 'template_redirect', + static function () { + $target = 'https://example.com/post/' . ( 'format' === $GLOBALS['md_alt_route'] ? '?format=markdown' : '' ); + $target = apply_filters( 'redirect_canonical', $target, 'https://example.com/post' ); + if ( $target ) { + wp_safe_redirect( $target, 301 ); + exit; + } + }, + 10 + ); + } + do_action( 'template_redirect' ); + echo 'HTML template'; +} diff --git a/tests/run.php b/tests/run.php index daf048a..6cd6146 100644 --- a/tests/run.php +++ b/tests/run.php @@ -439,6 +439,8 @@ static function () { md_alt_assert_same( $url, $integration->rewrite_post_link( $url, $post ), 'guard reset after exception' ); }; +require __DIR__ . '/security.php'; + $md_alt_failures = 0; foreach ( $md_alt_tests as $md_alt_name => $md_alt_test ) { try { diff --git a/tests/security.php b/tests/security.php new file mode 100644 index 0000000..ea4ec6b --- /dev/null +++ b/tests/security.php @@ -0,0 +1,205 @@ +Log out' + : 'Log in'; + } + ); + return $post; +} + +$md_alt_tests['A logged-in cache miss cannot leak a logout nonce to an anonymous visitor'] = static function () { + $post = md_alt_personalized_fixture(); + $renderer = new ContentRenderer(); + $GLOBALS['md_alt_test_state']['logged_in'] = true; + md_alt_assert_contains( 'private-test-nonce', $renderer->render( $post ) ); + md_alt_assert_same( false, get_transient( 'md_alt_cache_17' ) ); + $GLOBALS['md_alt_test_state']['logged_in'] = false; + $anonymous = $renderer->render( $post ); + md_alt_assert_contains( 'Log in', $anonymous ); + md_alt_assert_same( false, strpos( $anonymous, 'private-test-nonce' ) ); + md_alt_assert_same( $anonymous, $renderer->render( $post ) ); + md_alt_assert_same( 2, $GLOBALS['md_alt_test_state']['renders'] ); +}; + +$md_alt_tests['Logged-in requests neither read nor replace the anonymous cache, including after expiration'] = static function () { + $post = md_alt_personalized_fixture(); + $renderer = new ContentRenderer(); + $renderer->render( $post ); + $anonymous_cache = get_transient( 'md_alt_cache_17' ); + $GLOBALS['md_alt_test_state']['logged_in'] = true; + md_alt_assert_contains( 'private-test-nonce', $renderer->render( $post ) ); + md_alt_assert_same( $anonymous_cache, get_transient( 'md_alt_cache_17' ) ); + // WordPress returns false from get_transient() once an entry expires. + delete_transient( 'md_alt_cache_17' ); + md_alt_assert_contains( 'private-test-nonce', $renderer->render( $post ) ); + md_alt_assert_same( false, get_transient( 'md_alt_cache_17' ) ); + $GLOBALS['md_alt_test_state']['logged_in'] = false; + md_alt_assert_same( false, strpos( $renderer->render( $post ), 'private-test-nonce' ) ); +}; + +$md_alt_tests['Pre-fix caches with a matching integration version are discarded'] = static function () { + $post = md_alt_personalized_fixture(); + add_filter( + 'markdown_alternate_cache_version', + static function () { + return 'integration-v1'; + } + ); + set_transient( + 'md_alt_cache_17', + array( + 'markdown' => 'private-test-nonce', + 'modified' => $post->post_modified, + 'version' => 'integration-v1', + ), + DAY_IN_SECONDS + ); + $renderer = new ContentRenderer(); + $output = $renderer->render( $post ); + md_alt_assert_same( false, strpos( $output, 'private-test-nonce' ) ); + md_alt_assert_contains( 'Log in', $output ); + md_alt_assert_same( $output, $renderer->render( $post ) ); + md_alt_assert_same( 1, $GLOBALS['md_alt_test_state']['renders'] ); +}; + +$md_alt_tests['Known guest sessions bypass shared reads and writes'] = static function () { + foreach ( array( 'wp-postpass_test', 'wp_woocommerce_session_test', 'woocommerce_items_in_cart', 'woocommerce_cart_hash', 'edd_items_in_cart' ) as $cookie ) { + $post = md_alt_test_fixture( 'ordinary' ); + $renderer = new ContentRenderer(); + $renderer->render( $post ); + $cache = get_transient( 'md_alt_cache_17' ); + $_COOKIE[ $cookie ] = 'dummy-session'; + $post->post_content = '

Private guest content

'; + md_alt_assert_contains( 'Private guest content', $renderer->render( $post ) ); + md_alt_assert_same( $cache, get_transient( 'md_alt_cache_17' ), $cookie ); + delete_transient( 'md_alt_cache_17' ); + $renderer->render( $post ); + md_alt_assert_same( false, get_transient( 'md_alt_cache_17' ), $cookie ); + } +}; + +$md_alt_tests['Cache filters cannot opt authenticated or password-protected output back into sharing'] = static function () { + $post = md_alt_test_fixture( 'ordinary' ); + add_filter( + 'markdown_alternate_cache_enabled', + static function () { + return true; + } + ); + $GLOBALS['md_alt_test_state']['logged_in'] = true; + md_alt_assert_same( false, CachePolicy::is_enabled( $post ) ); + $GLOBALS['md_alt_test_state']['logged_in'] = false; + $post->post_password = 'dummy-password'; + md_alt_assert_same( false, CachePolicy::is_enabled( $post ) ); + ( new ContentRenderer() )->render( $post ); + md_alt_assert_same( false, get_transient( 'md_alt_cache_17' ) ); +}; + +$md_alt_tests['Unrelated cookies retain caching and integrations can disable custom sessions'] = static function () { + $post = md_alt_test_fixture( 'ordinary' ); + $_COOKIE['wordpress_test_cookie'] = 'test'; + md_alt_assert_same( true, CachePolicy::is_enabled( $post ) ); + add_filter( + 'markdown_alternate_cache_enabled', + static function () { + return false; + } + ); + md_alt_assert_same( false, CachePolicy::is_enabled( $post ) ); +}; + +/** + * Run a terminating router request in its own process. + * + * @param string $route Request route. + * @param string $mode Visitor or redirect scenario. + * @return array Captured response. + */ +function md_alt_router_request( $route, $mode ) { + $command = escapeshellarg( PHP_BINARY ) . ' ' . escapeshellarg( __DIR__ . '/router-request.php' ) . ' ' . escapeshellarg( $route ) . ' ' . escapeshellarg( $mode ); + $descriptors = array( + 1 => array( 'pipe', 'w' ), + 2 => array( 'pipe', 'w' ), + ); + $process = proc_open( $command, $descriptors, $pipes ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.system_calls_proc_open -- Isolate exit() in a CLI test child. + $output = stream_get_contents( $pipes[1] ); + $error = stream_get_contents( $pipes[2] ); + fclose( $pipes[1] ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose + fclose( $pipes[2] ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose + md_alt_assert_same( 0, proc_close( $process ), $error ); + $response = json_decode( $output, true ); + md_alt_assert_same( true, is_array( $response ), $output ); + return $response; +} + +foreach ( array( 'md', 'format', 'accept' ) as $md_alt_route ) { + $md_alt_tests[ 'Access checks run before ' . $md_alt_route . ' responses' ] = static function () use ( $md_alt_route ) { + foreach ( array( 'deny10', 'deny14' ) as $mode ) { + $response = md_alt_router_request( $md_alt_route, $mode ); + md_alt_assert_same( 403, $response['status'] ); + md_alt_assert_same( 'Access denied', $response['body'] ); + md_alt_assert_same( 0, $response['renders'] ); + md_alt_assert_same( array(), $response['cache'] ); + } + }; +} + +foreach ( array( 'md', 'format' ) as $md_alt_route ) { + $md_alt_tests[ 'Private HTTP and transient cache policy agree for ' . $md_alt_route ] = static function () use ( $md_alt_route ) { + foreach ( array( 'logged-in', 'session', 'password', 'filter-disabled' ) as $mode ) { + $response = md_alt_router_request( $md_alt_route, $mode ); + md_alt_assert_same( 200, $response['status'], $mode ); + md_alt_assert_contains( 'private, no-store', $response['headers']['Cache-Control'] ); + md_alt_assert_same( true, $response['page_cache_disabled'] ); + md_alt_assert_same( array(), $response['cache'] ); + } + $response = md_alt_router_request( $md_alt_route, 'anonymous' ); + md_alt_assert_same( 200, $response['status'] ); + md_alt_assert_same( 'text/markdown; charset=UTF-8', $response['headers']['Content-Type'] ); + md_alt_assert_same( true, isset( $response['cache']['md_alt_cache_17'] ) ); + }; +} + +$md_alt_tests['Canonical redirects precede format and Accept handling, but do not replace .md URLs'] = static function () { + foreach ( array( 'format', 'accept' ) as $route ) { + $response = md_alt_router_request( $route, 'canonical' ); + md_alt_assert_same( 301, $response['status'] ); + md_alt_assert_contains( '/post/', $response['headers']['Location'] ); + md_alt_assert_same( 0, $response['renders'] ); + } + $response = md_alt_router_request( 'md', 'canonical' ); + md_alt_assert_same( 200, $response['status'] ); + md_alt_assert_contains( '# Post Title', $response['body'] ); +}; + +$md_alt_tests['Accept negotiation and explicit format precedence remain unchanged'] = static function () { + $response = md_alt_router_request( 'accept', 'anonymous' ); + md_alt_assert_same( 303, $response['status'] ); + md_alt_assert_same( 'https://example.com/post.md', $response['headers']['Location'] ); + md_alt_assert_same( 0, $response['renders'] ); + $response = md_alt_router_request( 'format', 'also-accept' ); + md_alt_assert_same( 200, $response['status'] ); + md_alt_assert_contains( '# Post Title', $response['body'] ); + $response = md_alt_router_request( 'html', 'anonymous' ); + md_alt_assert_same( 'HTML template', $response['body'] ); + md_alt_assert_same( 0, $response['renders'] ); +}; From 12e73cc5346619eb8afd59c4c769a6dedf1e25b5 Mon Sep 17 00:00:00 2001 From: Joost de Valk Date: Wed, 25 Nov 2026 20:11:04 +0100 Subject: [PATCH 2/2] Prepare Markdown Alternate 1.2.1 --- markdown-alternate.php | 4 ++-- readme.txt | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/markdown-alternate.php b/markdown-alternate.php index 97624c8..523ce29 100644 --- a/markdown-alternate.php +++ b/markdown-alternate.php @@ -3,7 +3,7 @@ * Plugin Name: Markdown Alternate * Plugin URI: https://github.com/ProgressPlanner/markdown-alternate * Description: Provides markdown versions of posts and pages via .md URLs - * Version: 1.2.0 + * Version: 1.2.1 * Requires at least: 6.0 * Requires PHP: 7.4 * Author: Joost de Valk @@ -18,7 +18,7 @@ } define('MARKDOWN_ALTERNATE_FILE', __FILE__); -define( 'MARKDOWN_ALTERNATE_VERSION', '1.2.0' ); +define( 'MARKDOWN_ALTERNATE_VERSION', '1.2.1' ); require_once __DIR__ . '/vendor/autoload.php'; diff --git a/readme.txt b/readme.txt index ed5e1f6..44f7156 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: markdown, llm, ai, content, api Requires at least: 6.0 Tested up to: 7.2 Requires PHP: 7.4 -Stable tag: 1.2.0 +Stable tag: 1.2.1 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -102,8 +102,8 @@ Yes, as an opt-in. With `add_filter( 'markdown_alternate_skip_noindexed', '__ret == Changelog == -= Unreleased = -* Prevented visitor-specific Markdown from entering shared caches and invalidated previously generated entries += 1.2.1 = +* Security: Prevented logged-in and known session-specific Markdown from entering shared caches, and invalidated previously generated entries * Moved Markdown response handlers after default-priority access checks and canonical redirects * Added cache-isolation, response-header, and routing-order regression tests