@@ -56,29 +56,27 @@ strong caching headers to the response.
56
56
** "Cache Strategy" Object** - a "cache strategy" object should implement one or
57
57
more of the following methods:
58
58
59
- - ` lastModified(filename, cb ) ` - a function that accepts a filename and returns
60
- its last modified date to the callback . If a last modified date could not
61
- be determined, null is passed to the callback ; otherwise, static-asset
59
+ - ` lastModified(filename) ` - a function that accepts a filename and returns
60
+ its last modified date. If a last modified date could not
61
+ be determined, the function should return `null` ; otherwise, static-asset
62
62
*may* use this Date to set the `Last-Modified` HTTP response header when
63
63
the resource is requested.
64
-
65
- - `label_or_filename` - a label or filename in `path`
66
- - `cb` - a callback of the form `cb(err, lastModifiedDate)`
67
64
- ` etag(filename, cb) ` - Same as lastModified (above), except that it must
68
- return an ETag (or hash value) to the callback . If the
69
- returned ETag is not null, static-asset *may* use this value to set the
65
+ return an ETag (or hash value). If the
66
+ returned ETag is not ` null` , static-asset *may* use this value to set the
70
67
`ETag` HTTP header when the named resource is requested.
71
- - ` expires(filename, cb ) ` - Same as lastModified (above), except
68
+ - ` expires(filename) ` - Same as lastModified (above), except
72
69
that it must return a Date Object indicating when the resource shall
73
70
expire. The Date may be no more than one year in the future. If
74
71
`expires` is implemented, static-asset *may* use the date to set an
75
72
`Expires` and/or `Cache-Control: max-age` HTTP headers; otherwise,
76
73
static-asset will use a Date approximately one year into the future.
77
74
78
- ** req.assetFingerprint(label_or_filename)** - Using static-asset's "cache
79
- strategy", return a URL fingerprint for the labelled resource, or if no such
80
- label is registered, attempt to locate the specified filename within the ` path `
81
- to determine its fingerprint.
75
+ ** req.assetFingerprint(label_or_filename)** - Return a URL fingerprint for the
76
+ labelled resource, or if no such label is registered, use the "cache
77
+ strategy" to determine the file's ETag or last modified date. If an ETag is
78
+ provided by the cache strategy, it will be used to generate the fingerprint;
79
+ otherwise, the last modified date will be used.
82
80
83
81
** req.assetFingerprint(label, urlFingerprint, cacheInfo)** - Registers a URL
84
82
fingerprint for the specified label.
0 commit comments