Skip to content
Projects
Groups
Snippets
Help
Sign in / Register
Toggle navigation
Minds Frontend
Project overview
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
402
Merge Requests
63
CI / CD
Security & Compliance
Packages
Analytics
Wiki
Snippets
Members
Collapse sidebar
Close sidebar
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Frontend
Commits
37f6a355
Commit
37f6a355
authored
2 hours ago
by
Mark Harding
Browse files
Options
Download
(chore): reduce caching size and output stats
parent
0b7160e2
master
chore/remove-duplicate-bnjs
goal/local-infra
1 merge request
!754
Remove duplicate bnjs
Pipeline
#116527620
passed with stages
in 44 minutes and 49 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
server.ts
View file @
37f6a355
...
...
@@ -103,7 +103,10 @@ app.get('/undefined', (req, res) => {
// cache
const
NodeCache
=
require
(
'
node-cache
'
);
const
myCache
=
new
NodeCache
({
stdTTL
:
5
*
60
,
checkperiod
:
120
});
const
myCache
=
new
NodeCache
({
stdTTL
:
2
*
60
,
// 2 minute cache
checkperiod
:
60
,
// Check every minute
});
const
cache
=
()
=>
{
return
(
req
,
res
,
next
)
=>
{
...
...
@@ -132,6 +135,10 @@ const cache = () => {
};
};
app
.
get
(
'
node-cache-stats
'
,
(
req
,
res
)
=>
{
res
.
sendResponse
(
myCache
.
getStats
());
});
// All regular routes use the Universal engine
app
.
get
(
'
*
'
,
cache
(),
(
req
,
res
)
=>
{
const
http
=
...
...
This diff is collapsed.
Please
register
or
sign in
to comment