aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/client-html.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/client-html.ts')
-rw-r--r--server/lib/client-html.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/lib/client-html.ts b/server/lib/client-html.ts
index 1e7897220..44bd7abb5 100644
--- a/server/lib/client-html.ts
+++ b/server/lib/client-html.ts
@@ -12,12 +12,15 @@ import { AccountModel } from '../models/account/account'
12import { VideoChannelModel } from '../models/video/video-channel' 12import { VideoChannelModel } from '../models/video/video-channel'
13import * as Bluebird from 'bluebird' 13import * as Bluebird from 'bluebird'
14import { CONFIG } from '../initializers/config' 14import { CONFIG } from '../initializers/config'
15import { logger } from '../helpers/logger'
15 16
16export class ClientHtml { 17export class ClientHtml {
17 18
18 private static htmlCache: { [ path: string ]: string } = {} 19 private static htmlCache: { [ path: string ]: string } = {}
19 20
20 static invalidCache () { 21 static invalidCache () {
22 logger.info('Cleaning HTML cache.')
23
21 ClientHtml.htmlCache = {} 24 ClientHtml.htmlCache = {}
22 } 25 }
23 26
@@ -146,7 +149,7 @@ export class ClientHtml {
146 149
147 private static async addAsyncPluginCSS (htmlStringPage: string) { 150 private static async addAsyncPluginCSS (htmlStringPage: string) {
148 const globalCSSContent = await readFile(PLUGIN_GLOBAL_CSS_PATH) 151 const globalCSSContent = await readFile(PLUGIN_GLOBAL_CSS_PATH)
149 if (!globalCSSContent) return htmlStringPage 152 if (globalCSSContent.byteLength === 0) return htmlStringPage
150 153
151 const fileHash = sha256(globalCSSContent) 154 const fileHash = sha256(globalCSSContent)
152 const linkTag = `<link rel="stylesheet" href="/plugins/global.css?hash=${fileHash}" />` 155 const linkTag = `<link rel="stylesheet" href="/plugins/global.css?hash=${fileHash}" />`