- Index
- »
- web
- »
- FileWeblet
type
FileWeblet
src
class FileWeblet : Obj, Weblet
FileWeblet is used to service an HTTP request on a File
. It handles all the dirty details for cache control, compression, modification time, ETags, etc.
Default implementation uses gzip encoding if gzip is supported by the client and the file's MIME type has a "text" media type.
Current implementation supports ETags and Modification time for cache validation. It does not specify any cache control directives.
constructors
make |
Constructor with file to service. |
---|
fields
extraResHeaders |
Extra response headers to add for all 3xx and 2xx responses |
---|---|
file |
The file being serviced by this FileWeblet. |
methods
checkNotModified |
Check if the request passed headers indicating it has cached version of the file. |
---|---|
checkUnderDir |
Checks if the file being served is under the given directory. |
etag |
Compute the ETag for the file being serviced which uniquely identifies the file version. |
modified |
Get the modified time of the file floored to 1 second which is the most precise that HTTP can deal with. |
onGet |
Handle GET request for the file. |
onService |