aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib')
-rw-r--r--server/lib/client-html.ts5
-rw-r--r--server/lib/plugins/plugin-manager.ts2
2 files changed, 6 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}" />`
diff --git a/server/lib/plugins/plugin-manager.ts b/server/lib/plugins/plugin-manager.ts
index c0b49c7c7..a87d02c56 100644
--- a/server/lib/plugins/plugin-manager.ts
+++ b/server/lib/plugins/plugin-manager.ts
@@ -317,6 +317,8 @@ export class PluginManager implements ServerHook {
317 // ###################### CSS ###################### 317 // ###################### CSS ######################
318 318
319 private resetCSSGlobalFile () { 319 private resetCSSGlobalFile () {
320 ClientHtml.invalidCache()
321
320 return outputFile(PLUGIN_GLOBAL_CSS_PATH, '') 322 return outputFile(PLUGIN_GLOBAL_CSS_PATH, '')
321 } 323 }
322 324