Ssr Server
progressive-web-sdk/dist/utils/ssr-server
getAssetUrl(path)
Get the URL that should be used to load an asset from the bundle.
This function is provided for use in UPWAs.
Importimport { getAssetUrl } from 'progressive-web-sdk/dist/utils/ssr-server
Returns:
string
Parameter | Type | Description |
---|---|---|
path | string | the path to the asset (relative to the build directory) |
getHashForString(text)
Given a string, return a hash for that string. The hash is usable as an etag, or any other context where a summary hash of a string is required.
Importimport { getHashForString } from 'progressive-web-sdk/dist/utils/ssr-server
Returns:
string - the hash of that string, in hexadecimal
Parameter | Type | Description |
---|---|---|
text | string | the string to be hashed |
parseCacheControl(value)
Perform limited parsing of a Cache-Control header value, to extract the s-maxage and max-age values and return them.
Importimport { parseCacheControl } from 'progressive-web-sdk/dist/utils/ssr-server
Returns:
Object - with ‘max-age’ and ‘s-maxage’ properties mapped to String or undefined values.
Parameter | Type | Description |
---|---|---|
value | String | the value to parse |