Copilot commented on code in PR #12946:
URL: https://github.com/apache/trafficserver/pull/12946#discussion_r2897980653


##########
doc/admin-guide/plugins/compress.en.rst:
##########
@@ -98,10 +99,21 @@ Per site configuration for remap plugin should be ignored.
 cache
 -----
 
-When set to ``true``, causes |TS| to cache both the compressed and uncompressed
-versions of the content as :term:`alternates <alternate>`. When set to
-``false``, |TS| will cache only the compressed or decompressed variant returned
-by the origin. Enabled by default.
+Controls which version of the response is stored in cache when the compress
+transform runs (i.e., when the client sends ``Accept-Encoding``).
+
+When set to ``true``, the compressed (transformed) response is cached. When set
+to ``false``, the uncompressed (untransformed) response is cached and
+compression is performed on-the-fly for subsequent cache hits.
+
+.. note::
+
+   The plugin always adds ``Vary: Accept-Encoding`` to compressible responses.
+   This causes |TS| to store compressed and uncompressed responses as separate
+   :term:`alternates <alternate>`, so both variants will be cached after 
clients
+   of each type have made a request — regardless of this setting.

Review Comment:
   The note says `Vary: Accept-Encoding` means both compressed and uncompressed 
variants “will be cached … regardless of this setting”, but with `cache false` 
the plugin explicitly disables transformed-response caching (see 
`TSHttpTxnTransformedRespCache(txnp, 0)` in `compress_transform_add()`), so the 
compressed variant is generally not stored in cache. Please reword this note to 
clarify that `Vary: Accept-Encoding` creates separate cache alternates/keys for 
requests with different `Accept-Encoding`, but which body representation is 
stored still depends on the `cache` option (and with `cache false` compression 
is done on-the-fly).
   ```suggestion
      This causes |TS| to use separate cache :term:`alternates <alternate>` 
(keys)
      for requests with different ``Accept-Encoding`` values. Which body
      representation is actually stored in cache still depends on the ``cache``
      option: with ``cache true`` the compressed response is cached, while with
      ``cache false`` only the uncompressed response is cached and compression 
is
      performed on-the-fly for clients that send ``Accept-Encoding``.
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to