mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2026-03-01 18:31:35 +00:00
Cache some semi-static data
This commit is contained in:
parent
8c2a4454f2
commit
12c02fd8af
7 changed files with 12 additions and 8 deletions
|
|
@ -2,7 +2,7 @@ const constants = require("../../lib/constants")
|
|||
const {Feed} = require("feed")
|
||||
const {getFeedSetup} = require("../../lib/utils/feed")
|
||||
const {fetchUser, userRequestCache} = require("../../lib/collectors")
|
||||
const {render} = require("pinski/plugins")
|
||||
const {render, getStaticURL} = require("pinski/plugins")
|
||||
const {pugCache} = require("../passthrough")
|
||||
const {compile} = require("pug")
|
||||
|
||||
|
|
@ -80,7 +80,8 @@ module.exports = [
|
|||
"Retry-After": userRequestCache.getTtl("user/"+fill[0], 1000)
|
||||
},
|
||||
content: pugCache.get("pug/blocked.pug").web({
|
||||
expiresMinutes: userRequestCache.getTtl("user/"+fill[0], 1000*60)
|
||||
expiresMinutes: userRequestCache.getTtl("user/"+fill[0], 1000*60),
|
||||
getStaticURL
|
||||
})
|
||||
}
|
||||
} else if (error === constants.symbols.extractor_results.AGE_RESTRICTED) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
const constants = require("../../lib/constants")
|
||||
const switcher = require("../../lib/utils/torswitcher")
|
||||
const {fetchUser, getOrFetchShortcode, userRequestCache, history} = require("../../lib/collectors")
|
||||
const {render, redirect} = require("pinski/plugins")
|
||||
const {render, redirect, getStaticURL} = require("pinski/plugins")
|
||||
const {pugCache} = require("../passthrough")
|
||||
|
||||
/** @param {import("../../lib/structures/TimelineEntry")} post */
|
||||
|
|
@ -86,7 +86,8 @@ module.exports = [
|
|||
"Retry-After": userRequestCache.getTtl("user/"+fill[0], 1000)
|
||||
},
|
||||
content: pugCache.get("pug/blocked.pug").web({
|
||||
expiresMinutes: userRequestCache.getTtl("user/"+fill[0], 1000*60)
|
||||
expiresMinutes: userRequestCache.getTtl("user/"+fill[0], 1000*60),
|
||||
getStaticURL
|
||||
})
|
||||
}
|
||||
} else if (error === constants.symbols.extractor_results.AGE_RESTRICTED) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue