You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "ywkaras (via GitHub)" <gi...@apache.org> on 2024/05/23 19:39:18 UTC
[PR] Add Sphinx documentation for statichit plugin. [trafficserver]
ywkaras opened a new pull request, #11389:
URL: https://github.com/apache/trafficserver/pull/11389
Also remove obsolete readme file for statichit.
--
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: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add Sphinx documentation for statichit plugin. [trafficserver]
Posted by "mlibbey (via GitHub)" <gi...@apache.org>.
mlibbey commented on code in PR #11389:
URL: https://github.com/apache/trafficserver/pull/11389#discussion_r1612438247
##########
doc/admin-guide/plugins/statichit.en.rst:
##########
@@ -0,0 +1,106 @@
+.. _admin-plugins-statichit:
+.. include:: ../../common.defs
+
+Static Hit Plugin
+*****************
+
+.. Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+This is a simple plugin to serve static content from the proxy's local filesystem. It shares some
+of the same functionality as the `healthchecks` plugin, but is a remap plugin (thereby making it
+reloadable). It does not use fsnotify for watching the source files.
+
+When the plugin is invoked during remapping, if the transaction already has a status other than OK, the plugin
+will ignore the transaction.
+
+These are the available options for the plugin:
+
+================= ======= ========= ====== ==============
+Long Name One Required? Has Description
+ Letter Value?
+ Name
+================= ======= ========= ====== ==============
+--file-path -f Yes Yes File path. If the given path is relative, it is relative to the |TS|
+ configuration directory. If the specified file is a directory, it implies
+ --disable-exact, and URL path is appended to this directory path to get
+ the path for the file containing the body. If the specified file is not a
+ directory, it should contain the body.
+--mime-type -m No Yes Defaults to "text/plain".
+--max-age -a No Yes Defaults to "0". If the value is not 0, it gives the number of seconds the
+ static body will remain fresh when cache. (Including in the proxy's cache, if
+ enabled.)
+--failure-code -c No Yes Defaults to "404" (NOT FOUND). This response status will be returned if the
+ file which should contain the body does not exist. This option is
+ particularly useful when --file-path specifies a directory.
+--success-code -s No Yes Defaults to "200" (OK). This is the response status when the static object is
+ successfully returned in the transaction response.
+--disable-exact -d No No Disable "exact" URL match. "Exact" match, for this plugin, means the URL must
+ not include a path.
+================= ======= ========= ====== ==============
+
+When using long option names, the value can be specified by appending = and then the value. `@pparam=--max-age=5` for
+example. Otherwise, the value must be specified as the next pparam. `@pparam=-a @pparam=5` for example.
+
+When exact match is enabled, if the request URL has a path, a response with NOT FOUND status will be sent.
+
+Mime Headers in Responses with OK/200 Status
+============================================
+
+#. Content-Type. The value given with the --mime-type parameter, or its default value.
+#. Content-Length.
+#. Cache-Control. If --max-age is 0, the value will be "no-cache". Otherwise, the value will be "max-age=d", where
+ d stands for the value given with the --max-age parameter.
+#. if --max-age is not 0, Last-Modified is present, and gives the time the static body was last cached.
+
+Metrics
+=======
+
+The plugin publishes the following metrics:
+
+======================== ====================================================
+Name Description
+======================== ====================================================
+statichit.response_bytes The total number of bytes emitted
+statichit.response_count The number of HTTP responses generated by the plugin
+======================== ====================================================
+
+remap.config Examples:
+======================
+
Review Comment:
Serve a request for /internal/healthcheck with the contents of the file located at /var/run/trafficserver/healthcheck.txt. If the file is present, send with a Mime-type of text/plain. Als set the Cache-Control: header to no-cache.
##########
doc/admin-guide/plugins/statichit.en.rst:
##########
@@ -0,0 +1,106 @@
+.. _admin-plugins-statichit:
+.. include:: ../../common.defs
+
+Static Hit Plugin
+*****************
+
+.. Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+This is a simple plugin to serve static content from the proxy's local filesystem. It shares some
+of the same functionality as the `healthchecks` plugin, but is a remap plugin (thereby making it
+reloadable). It does not use fsnotify for watching the source files.
Review Comment:
Is this last sentence meant to imply that source file changes will need a reload to begin serving? If so, perhaps say that explicitly? like
"It does not use fsnotify for watching the source files. New content will be served after |TS| reloads."
##########
doc/admin-guide/plugins/statichit.en.rst:
##########
@@ -0,0 +1,106 @@
+.. _admin-plugins-statichit:
+.. include:: ../../common.defs
+
+Static Hit Plugin
+*****************
+
+.. Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+This is a simple plugin to serve static content from the proxy's local filesystem. It shares some
+of the same functionality as the `healthchecks` plugin, but is a remap plugin (thereby making it
+reloadable). It does not use fsnotify for watching the source files.
+
+When the plugin is invoked during remapping, if the transaction already has a status other than OK, the plugin
+will ignore the transaction.
+
+These are the available options for the plugin:
+
+================= ======= ========= ====== ==============
+Long Name One Required? Has Description
+ Letter Value?
+ Name
+================= ======= ========= ====== ==============
+--file-path -f Yes Yes File path. If the given path is relative, it is relative to the |TS|
+ configuration directory. If the specified file is a directory, it implies
+ --disable-exact, and URL path is appended to this directory path to get
+ the path for the file containing the body. If the specified file is not a
+ directory, it should contain the body.
+--mime-type -m No Yes Defaults to "text/plain".
+--max-age -a No Yes Defaults to "0". If the value is not 0, it gives the number of seconds the
+ static body will remain fresh when cache. (Including in the proxy's cache, if
+ enabled.)
+--failure-code -c No Yes Defaults to "404" (NOT FOUND). This response status will be returned if the
+ file which should contain the body does not exist. This option is
+ particularly useful when --file-path specifies a directory.
+--success-code -s No Yes Defaults to "200" (OK). This is the response status when the static object is
+ successfully returned in the transaction response.
+--disable-exact -d No No Disable "exact" URL match. "Exact" match, for this plugin, means the URL must
+ not include a path.
+================= ======= ========= ====== ==============
+
+When using long option names, the value can be specified by appending = and then the value. `@pparam=--max-age=5` for
+example. Otherwise, the value must be specified as the next pparam. `@pparam=-a @pparam=5` for example.
+
+When exact match is enabled, if the request URL has a path, a response with NOT FOUND status will be sent.
+
+Mime Headers in Responses with OK/200 Status
+============================================
+
+#. Content-Type. The value given with the --mime-type parameter, or its default value.
+#. Content-Length.
+#. Cache-Control. If --max-age is 0, the value will be "no-cache". Otherwise, the value will be "max-age=d", where
+ d stands for the value given with the --max-age parameter.
+#. if --max-age is not 0, Last-Modified is present, and gives the time the static body was last cached.
+
+Metrics
+=======
+
+The plugin publishes the following metrics:
+
+======================== ====================================================
+Name Description
+======================== ====================================================
+statichit.response_bytes The total number of bytes emitted
+statichit.response_count The number of HTTP responses generated by the plugin
+======================== ====================================================
+
+remap.config Examples:
+======================
+
+| map /internal/healthcheck \\
+| http://127.0.0.1 \\
+| @plugin=statichit.so @pparam=--file-path=/var/run/trafficserver/healthcheck.txt \\
+| @pparam=--mime-type=text/plain \\
+| @pparam=--success-code=200 \\
+| @pparam=--failure-code=403 \\
+| @pparam=--max-age=0 \\
+| @pparam=--disable-exact
+|
+| map http://content.example.com/content_xyz.txt \\
+| http://127.0.0.1 \\
+| @plugin=statichit.so @pparam=--file-path=/opt/ats/etc/trafficserver/content_bodies \\
+| @pparam=--failure-code=404 \\
+| @pparam=--max-age=604800
+|
Review Comment:
Serve a request for content.example.com/content_abc.json with the contents of the file located at /opt/ats/etc/trafficserver/content_bodies/content_abc.json (as /opt/ats/etc/trafficserver/content_bodies is meant to imply a directory in this example) with a mime-type of application/json. Set cache-control to have a max-age of 7 days (604800 seconds).
##########
doc/admin-guide/plugins/statichit.en.rst:
##########
@@ -0,0 +1,106 @@
+.. _admin-plugins-statichit:
+.. include:: ../../common.defs
+
+Static Hit Plugin
+*****************
+
+.. Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+This is a simple plugin to serve static content from the proxy's local filesystem. It shares some
+of the same functionality as the `healthchecks` plugin, but is a remap plugin (thereby making it
+reloadable). It does not use fsnotify for watching the source files.
+
+When the plugin is invoked during remapping, if the transaction already has a status other than OK, the plugin
+will ignore the transaction.
+
+These are the available options for the plugin:
+
+================= ======= ========= ====== ==============
+Long Name One Required? Has Description
+ Letter Value?
+ Name
+================= ======= ========= ====== ==============
+--file-path -f Yes Yes File path. If the given path is relative, it is relative to the |TS|
+ configuration directory. If the specified file is a directory, it implies
+ --disable-exact, and URL path is appended to this directory path to get
+ the path for the file containing the body. If the specified file is not a
+ directory, it should contain the body.
+--mime-type -m No Yes Defaults to "text/plain".
+--max-age -a No Yes Defaults to "0". If the value is not 0, it gives the number of seconds the
+ static body will remain fresh when cache. (Including in the proxy's cache, if
+ enabled.)
+--failure-code -c No Yes Defaults to "404" (NOT FOUND). This response status will be returned if the
+ file which should contain the body does not exist. This option is
+ particularly useful when --file-path specifies a directory.
+--success-code -s No Yes Defaults to "200" (OK). This is the response status when the static object is
+ successfully returned in the transaction response.
+--disable-exact -d No No Disable "exact" URL match. "Exact" match, for this plugin, means the URL must
+ not include a path.
+================= ======= ========= ====== ==============
+
+When using long option names, the value can be specified by appending = and then the value. `@pparam=--max-age=5` for
+example. Otherwise, the value must be specified as the next pparam. `@pparam=-a @pparam=5` for example.
+
+When exact match is enabled, if the request URL has a path, a response with NOT FOUND status will be sent.
+
+Mime Headers in Responses with OK/200 Status
+============================================
+
+#. Content-Type. The value given with the --mime-type parameter, or its default value.
+#. Content-Length.
+#. Cache-Control. If --max-age is 0, the value will be "no-cache". Otherwise, the value will be "max-age=d", where
Review Comment:
Is it really no-cache or no-store? Probably doesn't end up mattering for this use case, as the origin is still ATS, but no-cache is widely misunderstood, and would be good to not add to confusion :)
##########
doc/admin-guide/plugins/statichit.en.rst:
##########
@@ -0,0 +1,106 @@
+.. _admin-plugins-statichit:
+.. include:: ../../common.defs
+
+Static Hit Plugin
+*****************
+
+.. Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+This is a simple plugin to serve static content from the proxy's local filesystem. It shares some
+of the same functionality as the `healthchecks` plugin, but is a remap plugin (thereby making it
+reloadable). It does not use fsnotify for watching the source files.
+
+When the plugin is invoked during remapping, if the transaction already has a status other than OK, the plugin
+will ignore the transaction.
+
+These are the available options for the plugin:
+
+================= ======= ========= ====== ==============
+Long Name One Required? Has Description
+ Letter Value?
+ Name
+================= ======= ========= ====== ==============
+--file-path -f Yes Yes File path. If the given path is relative, it is relative to the |TS|
+ configuration directory. If the specified file is a directory, it implies
+ --disable-exact, and URL path is appended to this directory path to get
+ the path for the file containing the body. If the specified file is not a
+ directory, it should contain the body.
+--mime-type -m No Yes Defaults to "text/plain".
+--max-age -a No Yes Defaults to "0". If the value is not 0, it gives the number of seconds the
+ static body will remain fresh when cache. (Including in the proxy's cache, if
+ enabled.)
+--failure-code -c No Yes Defaults to "404" (NOT FOUND). This response status will be returned if the
+ file which should contain the body does not exist. This option is
+ particularly useful when --file-path specifies a directory.
+--success-code -s No Yes Defaults to "200" (OK). This is the response status when the static object is
+ successfully returned in the transaction response.
+--disable-exact -d No No Disable "exact" URL match. "Exact" match, for this plugin, means the URL must
+ not include a path.
+================= ======= ========= ====== ==============
+
+When using long option names, the value can be specified by appending = and then the value. `@pparam=--max-age=5` for
+example. Otherwise, the value must be specified as the next pparam. `@pparam=-a @pparam=5` for example.
+
+When exact match is enabled, if the request URL has a path, a response with NOT FOUND status will be sent.
+
+Mime Headers in Responses with OK/200 Status
+============================================
+
+#. Content-Type. The value given with the --mime-type parameter, or its default value.
+#. Content-Length.
+#. Cache-Control. If --max-age is 0, the value will be "no-cache". Otherwise, the value will be "max-age=d", where
+ d stands for the value given with the --max-age parameter.
+#. if --max-age is not 0, Last-Modified is present, and gives the time the static body was last cached.
+
+Metrics
+=======
+
+The plugin publishes the following metrics:
+
+======================== ====================================================
+Name Description
+======================== ====================================================
+statichit.response_bytes The total number of bytes emitted
+statichit.response_count The number of HTTP responses generated by the plugin
+======================== ====================================================
+
+remap.config Examples:
+======================
+
+| map /internal/healthcheck \\
+| http://127.0.0.1 \\
+| @plugin=statichit.so @pparam=--file-path=/var/run/trafficserver/healthcheck.txt \\
+| @pparam=--mime-type=text/plain \\
+| @pparam=--success-code=200 \\
+| @pparam=--failure-code=403 \\
+| @pparam=--max-age=0 \\
+| @pparam=--disable-exact
+|
Review Comment:
Serve a request for content.example.com/content_xyz.txt with the contents of the file located at /opt/ats/etc/trafficserver/content_bodies/content_xyz.txt (as /opt/ats/etc/trafficserver/content_bodies is meant to imply a directory in this example).
--
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: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add Sphinx documentation for statichit plugin. [trafficserver]
Posted by "ywkaras (via GitHub)" <gi...@apache.org>.
ywkaras commented on PR #11389:
URL: https://github.com/apache/trafficserver/pull/11389#issuecomment-2139962407
[approve ci autest]
--
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: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add Sphinx documentation for statichit plugin. [trafficserver]
Posted by "ywkaras (via GitHub)" <gi...@apache.org>.
ywkaras commented on PR #11389:
URL: https://github.com/apache/trafficserver/pull/11389#issuecomment-2174521993
[approve ci]
--
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: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add Sphinx documentation for statichit plugin. [trafficserver]
Posted by "JosiahWI (via GitHub)" <gi...@apache.org>.
JosiahWI commented on PR #11389:
URL: https://github.com/apache/trafficserver/pull/11389#issuecomment-2175842392
The AuTest proxy_protocol failed the run "Proxy Protocol v1 without blind tunneling on TLS connection to origin:":
```
Process: Default: Failed
Setting up : Copying '/home/jenkins/workspace/Github_Builds/autest/src/build/proxy-verifier-v2.10.1/linux-amd64' to '/tmp/sandbox/proxy_protocol/pp-out-client-4/bin' - Passed
Setting up : Copying 'replay/proxy_protocol_out.replay.yaml' to '/tmp/sandbox/proxy_protocol/pp-out-client-4/proxy_protocol_out.replay.yaml' - Passed
Setting up : Copying '/home/jenkins/workspace/Github_Builds/autest/src/tests/gold_tests/autest-site/../../tools/proxy-verifier/ssl/client.pem' to '/tmp/sandbox/proxy_protocol/pp-out-client-4/client.pem' - Passed
Setting up : Copying '/home/jenkins/workspace/Github_Builds/autest/src/tests/gold_tests/autest-site/../../tools/proxy-verifier/ssl/ca.pem' to '/tmp/sandbox/proxy_protocol/pp-out-client-4/ca.pem' - Passed
Test : Checking that ReturnCode == 0 - Failed
Reason: Returned Value 1 != 0
Time-Out : Process finishes within expected time - Passed
Reason: Returned value: 5.030939340591431 < 600.0
file /tmp/sandbox/proxy_protocol/_output/6-tr-Default/stream.all.txt : Verify the client got a 200 response. - Failed
Reason: Contents of /tmp/sandbox/proxy_protocol/_output/6-tr-Default/stream.all.txt did not contains expression: "HTTP/1.1 200 OK"
```
--
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: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add Sphinx documentation for statichit plugin. [trafficserver]
Posted by "JosiahWI (via GitHub)" <gi...@apache.org>.
JosiahWI commented on PR #11389:
URL: https://github.com/apache/trafficserver/pull/11389#issuecomment-2175842642
[approve ci rocky autest]
--
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: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add Sphinx documentation for statichit plugin. [trafficserver]
Posted by "ywkaras (via GitHub)" <gi...@apache.org>.
ywkaras commented on PR #11389:
URL: https://github.com/apache/trafficserver/pull/11389#issuecomment-2140121905
This is purely a documentation and testing enhancement. Backports are desirable but not crucial.
--
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: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add Sphinx documentation for statichit plugin. [trafficserver]
Posted by "JosiahWI (via GitHub)" <gi...@apache.org>.
JosiahWI commented on PR #11389:
URL: https://github.com/apache/trafficserver/pull/11389#issuecomment-2175943333
[approve ci rocky]
--
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: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add Sphinx documentation for statichit plugin. [trafficserver]
Posted by "ywkaras (via GitHub)" <gi...@apache.org>.
ywkaras commented on PR #11389:
URL: https://github.com/apache/trafficserver/pull/11389#issuecomment-2128193689
[approve ci docs]
--
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: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add Sphinx documentation for statichit plugin. [trafficserver]
Posted by "mlibbey (via GitHub)" <gi...@apache.org>.
mlibbey commented on code in PR #11389:
URL: https://github.com/apache/trafficserver/pull/11389#discussion_r1613772122
##########
doc/admin-guide/plugins/statichit.en.rst:
##########
@@ -0,0 +1,106 @@
+.. _admin-plugins-statichit:
+.. include:: ../../common.defs
+
+Static Hit Plugin
+*****************
+
+.. Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+This is a simple plugin to serve static content from the proxy's local filesystem. It shares some
+of the same functionality as the `healthchecks` plugin, but is a remap plugin (thereby making it
+reloadable). It does not use fsnotify for watching the source files.
+
+When the plugin is invoked during remapping, if the transaction already has a status other than OK, the plugin
+will ignore the transaction.
+
+These are the available options for the plugin:
+
+================= ======= ========= ====== ==============
+Long Name One Required? Has Description
+ Letter Value?
+ Name
+================= ======= ========= ====== ==============
+--file-path -f Yes Yes File path. If the given path is relative, it is relative to the |TS|
+ configuration directory. If the specified file is a directory, it implies
+ --disable-exact, and URL path is appended to this directory path to get
+ the path for the file containing the body. If the specified file is not a
+ directory, it should contain the body.
+--mime-type -m No Yes Defaults to "text/plain".
+--max-age -a No Yes Defaults to "0". If the value is not 0, it gives the number of seconds the
+ static body will remain fresh when cache. (Including in the proxy's cache, if
+ enabled.)
+--failure-code -c No Yes Defaults to "404" (NOT FOUND). This response status will be returned if the
+ file which should contain the body does not exist. This option is
+ particularly useful when --file-path specifies a directory.
+--success-code -s No Yes Defaults to "200" (OK). This is the response status when the static object is
+ successfully returned in the transaction response.
+--disable-exact -d No No Disable "exact" URL match. "Exact" match, for this plugin, means the URL must
+ not include a path.
+================= ======= ========= ====== ==============
+
+When using long option names, the value can be specified by appending = and then the value. `@pparam=--max-age=5` for
+example. Otherwise, the value must be specified as the next pparam. `@pparam=-a @pparam=5` for example.
+
+When exact match is enabled, if the request URL has a path, a response with NOT FOUND status will be sent.
+
+Mime Headers in Responses with OK/200 Status
+============================================
+
+#. Content-Type. The value given with the --mime-type parameter, or its default value.
+#. Content-Length.
+#. Cache-Control. If --max-age is 0, the value will be "no-cache". Otherwise, the value will be "max-age=d", where
Review Comment:
Great! no-store is the right CC directive to never cache :)
--
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: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add Sphinx documentation for statichit plugin. [trafficserver]
Posted by "ywkaras (via GitHub)" <gi...@apache.org>.
ywkaras commented on code in PR #11389:
URL: https://github.com/apache/trafficserver/pull/11389#discussion_r1612485838
##########
doc/admin-guide/plugins/statichit.en.rst:
##########
@@ -0,0 +1,106 @@
+.. _admin-plugins-statichit:
+.. include:: ../../common.defs
+
+Static Hit Plugin
+*****************
+
+.. Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+This is a simple plugin to serve static content from the proxy's local filesystem. It shares some
+of the same functionality as the `healthchecks` plugin, but is a remap plugin (thereby making it
+reloadable). It does not use fsnotify for watching the source files.
+
+When the plugin is invoked during remapping, if the transaction already has a status other than OK, the plugin
+will ignore the transaction.
+
+These are the available options for the plugin:
+
+================= ======= ========= ====== ==============
+Long Name One Required? Has Description
+ Letter Value?
+ Name
+================= ======= ========= ====== ==============
+--file-path -f Yes Yes File path. If the given path is relative, it is relative to the |TS|
+ configuration directory. If the specified file is a directory, it implies
+ --disable-exact, and URL path is appended to this directory path to get
+ the path for the file containing the body. If the specified file is not a
+ directory, it should contain the body.
+--mime-type -m No Yes Defaults to "text/plain".
+--max-age -a No Yes Defaults to "0". If the value is not 0, it gives the number of seconds the
+ static body will remain fresh when cache. (Including in the proxy's cache, if
+ enabled.)
+--failure-code -c No Yes Defaults to "404" (NOT FOUND). This response status will be returned if the
+ file which should contain the body does not exist. This option is
+ particularly useful when --file-path specifies a directory.
+--success-code -s No Yes Defaults to "200" (OK). This is the response status when the static object is
+ successfully returned in the transaction response.
+--disable-exact -d No No Disable "exact" URL match. "Exact" match, for this plugin, means the URL must
+ not include a path.
+================= ======= ========= ====== ==============
+
+When using long option names, the value can be specified by appending = and then the value. `@pparam=--max-age=5` for
+example. Otherwise, the value must be specified as the next pparam. `@pparam=-a @pparam=5` for example.
+
+When exact match is enabled, if the request URL has a path, a response with NOT FOUND status will be sent.
+
+Mime Headers in Responses with OK/200 Status
+============================================
+
+#. Content-Type. The value given with the --mime-type parameter, or its default value.
+#. Content-Length.
+#. Cache-Control. If --max-age is 0, the value will be "no-cache". Otherwise, the value will be "max-age=d", where
Review Comment:
https://github.com/apache/trafficserver/blob/b46f5d061af455dc75956346da3308788381b30d/plugins/statichit/statichit.cc#L337 . Core TS seems to add a no-store cache control header for 4xx responses. (May be affected by negative caching config.)
--
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: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add Sphinx documentation for statichit plugin. [trafficserver]
Posted by "ezelkow1 (via GitHub)" <gi...@apache.org>.
ezelkow1 commented on PR #11389:
URL: https://github.com/apache/trafficserver/pull/11389#issuecomment-2596280318
Do we still need this for 9.2?
--
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: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org