-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
send longer cache headers by default (#1725)
* tell browsers and downstream caches to cache for `env.BADGE_MAX_AGE_SECONDS`, default 0 for dev * set Cache-Control: no-cache, no-store, must-revalidate if maxAge=0 * add servertime badge to help with cache header debugging * if service category is 'debug', exclude from examples * ignore maxAge GET param if less than `env.BADGE_MAX_AGE_SECONDS`
- Loading branch information
Showing
5 changed files
with
86 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
'use strict'; | ||
|
||
const BaseService = require('../base'); | ||
|
||
module.exports = class Time extends BaseService { | ||
|
||
async handle() { | ||
return { message: new Date() }; | ||
} | ||
|
||
// Metadata | ||
static get defaultBadgeData() { | ||
return { | ||
label: 'time', | ||
color: 'blue', | ||
}; | ||
} | ||
|
||
static get category() { | ||
return 'debug'; | ||
} | ||
|
||
static get url() { | ||
return { | ||
base: 'servertime', | ||
format: '', | ||
capture: [] | ||
}; | ||
} | ||
|
||
}; |