(static) (require("middlewares/disableCacheMiddleware"))(request, response, next)
Defines an express middleware to deactivate user agent cache of requests.
- Cache-Control : no-cache to force caches to request the original server
- Cache-Control : no-store to force caches not to keep any copy of the response
- Cache-Control : must-revalidate to force caches to ask original server validation of a stale response
- Pragma : no-cache to be backward compatible with HTTP/1.0 caches
- Expires : 0 to mark all responses as staled
Parameters:
Name | Type | Description |
---|---|---|
request |
Object | The Express.JS Request object |
response |
Object | The Express.JS Response object |
next |
Object | The Express.JS next function |
Example
var openVeoApi = require('@openveo/api');
expressApp.use(openVeoApi.middlewares.disableCacheMiddleware);