Skip to content

Commit 1bc91aa

Browse files
committed
update docs and give example
1 parent 632ef6e commit 1bc91aa

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

doc/admin-guide/plugins/prefetch.en.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,29 @@ specified with an integer followed by a colon, e.g. ``{8:$2+2}``,
170170
causing the resulting number to be padded with leading zeroes if it
171171
has fewer digits than the width.
172172

173+
CMCD (Common Media Client Data) CMCD-Request header with nor field
174+
------------------------------------------------------------------
175+
176+
If the ``--cmcd-nor`` option is specified the Cmcd-Request header with nor field is handled.
177+
178+
With setup ::
179+
180+
map http://example.com http://origin.com \
181+
@plugin=cachekey.so @pparam=--remove-all-params=true \
182+
@plugin=prefetch.so \
183+
@pparam=--cmcd-nor=true
184+
185+
If the incoming request is ::
186+
187+
http://example-seed.com/path/someitem.m4a
188+
189+
with header ::
190+
191+
Cmcd-Request: nor="otheritem.m4a"
192+
193+
The following URL will be requested to be prefetched ::
194+
195+
http://example-seed.com/path/otheritem.m4a
173196

174197
Overhead from **next object** prefetch
175198
--------------------------------------
@@ -238,6 +261,7 @@ Plugin parameters
238261
- ``true`` - configures the plugin run on the **front-tier**,
239262
- ``false`` - to be run on the **back-tier**.
240263
* ``--api-header`` - the header used by the plugin internally, also used to mark a prefetch request to the next tier in dual-tier usage.
264+
* ``--cmcd-nor`` - prefetch for a Cmcd-Request header with nor field.
241265
* ``--fetch-policy`` - fetch policy
242266
- ``simple`` - this policy just makes sure there are no same concurrent prefetches triggered (default and always used in combination with any other policy)
243267
- ``lru:n`` - this policy uses LRU to identify "hot" objects and triggers prefetch if the object is not found. `n` is the size of the LRU

plugins/prefetch/plugin.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ contHandleFetch(const TSCont contp, TSEvent event, void *edata)
573573
String const relpath = getCmcdNor(reqBuffer, reqHdrLoc);
574574
if (!relpath.empty()) {
575575
PrefetchDebug("Current path: '%s'", currentPath.c_str());
576-
PrefetchDebug("Parsed cmcd nor relpah: '%s'", relpath.c_str());
576+
PrefetchDebug("Parsed cmcd nor relpath: '%s'", relpath.c_str());
577577

578578
String nextPath;
579579
String::size_type const spos = currentPath.find_last_of('/');

0 commit comments

Comments
 (0)