-
Notifications
You must be signed in to change notification settings - Fork 796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Sphinx documentation for statichit plugin. #11389
Conversation
2eaa114
to
6bb7133
Compare
|
||
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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."
|
||
#. 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trafficserver/plugins/statichit/statichit.cc
Line 337 in b46f5d0
HeaderFieldStringSet(response, TS_MIME_FIELD_CACHE_CONTROL, TS_MIME_LEN_CACHE_CONTROL, "no-cache"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! no-store is the right CC directive to never cache :)
| @pparam=--failure-code=403 \\ | ||
| @pparam=--max-age=0 \\ | ||
| @pparam=--disable-exact | ||
| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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).
| @plugin=statichit.so @pparam=--file-path=/opt/ats/etc/trafficserver/content_bodies \\ | ||
| @pparam=--failure-code=404 \\ | ||
| @pparam=--max-age=604800 | ||
| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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).
dc5ed6a
to
4ae0db8
Compare
Also remove obsolete readme file for statichit.
This is purely a documentation and testing enhancement. Backports are desirable but not crucial. |
[approve ci] |
The AuTest proxy_protocol failed the run "Proxy Protocol v1 without blind tunneling on TLS connection to origin:":
|
Cherry-picked to v10.0.x |
* Add Sphinx documentation for statichit plugin. Also remove obsolete readme file for statichit. * Improve Au test for statichit plugin. (cherry picked from commit e226cc7)
Also remove obsolete readme file for statichit. Also improve Au test for statichit.