mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Rename enableCache() to initCache() to make code easier to understand
This commit is contained in:
@@ -93,12 +93,12 @@ export function app() {
|
|||||||
/*
|
/*
|
||||||
* If production mode is enabled in the environment file:
|
* If production mode is enabled in the environment file:
|
||||||
* - Enable Angular's production mode
|
* - Enable Angular's production mode
|
||||||
* - Enable caching of SSR rendered pages (if enabled in config.yml)
|
* - Initialize caching of SSR rendered pages (if enabled in config.yml)
|
||||||
* - Enable compression for SSR reponses. See [compression](https://github.com/expressjs/compression)
|
* - Enable compression for SSR reponses. See [compression](https://github.com/expressjs/compression)
|
||||||
*/
|
*/
|
||||||
if (environment.production) {
|
if (environment.production) {
|
||||||
enableProdMode();
|
enableProdMode();
|
||||||
enableCache();
|
initCache();
|
||||||
server.use(compression({
|
server.use(compression({
|
||||||
// only compress responses we've marked as SSR
|
// only compress responses we've marked as SSR
|
||||||
// otherwise, this middleware may compress files we've chosen not to compress via compression-webpack-plugin
|
// otherwise, this middleware may compress files we've chosen not to compress via compression-webpack-plugin
|
||||||
@@ -310,9 +310,9 @@ function addCacheControl(req, res, next) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Enable server-side caching of pages rendered via SSR.
|
* Initialize server-side caching of pages rendered via SSR.
|
||||||
*/
|
*/
|
||||||
function enableCache() {
|
function initCache() {
|
||||||
if (cacheEnabled()) {
|
if (cacheEnabled()) {
|
||||||
// Initialize a new "least-recently-used" item cache (where least recently used items are removed first)
|
// Initialize a new "least-recently-used" item cache (where least recently used items are removed first)
|
||||||
// See https://www.npmjs.com/package/lru-cache
|
// See https://www.npmjs.com/package/lru-cache
|
||||||
|
Reference in New Issue
Block a user