diff --git a/application/Espo/Core/Utils/ClientManager.php b/application/Espo/Core/Utils/ClientManager.php index d42e31ff70..45743f0cf3 100644 --- a/application/Espo/Core/Utils/ClientManager.php +++ b/application/Espo/Core/Utils/ClientManager.php @@ -86,7 +86,9 @@ class ClientManager $htmlFilePath = $this->mainHtmlFilePath; } - if ($this->getConfig()->get('isDeveloperMode')) { + $isDeveloperMode = $this->getConfig()->get('isDeveloperMode'); + + if ($isDeveloperMode) { if (file_exists('frontend/' . $htmlFilePath)) { $htmlFilePath = 'frontend/' . $htmlFilePath; } @@ -102,6 +104,9 @@ class ClientManager $html = str_replace('{{stylesheet}}', $this->getThemeManager()->getStylesheet(), $html); $html = str_replace('{{runScript}}', $runScript , $html); $html = str_replace('{{basePath}}', $this->basePath , $html); + if ($isDeveloperMode) { + $html = str_replace('{{useCacheInDeveloperMode}}', $this->getConfig()->get('useCacheInDeveloperMode') ? 'true' : 'false', $html); + } echo $html; exit; diff --git a/frontend/html/main.html b/frontend/html/main.html index 171a748fed..46c516a856 100644 --- a/frontend/html/main.html +++ b/frontend/html/main.html @@ -34,7 +34,7 @@ $(function () { Espo.require('app', function (App) { var app = new App({ - useCache: false, + useCache: {{useCacheInDeveloperMode}}, cacheTimestamp: {{cacheTimestamp}}, url: 'api/v1', basePath: '{{basePath}}' diff --git a/frontend/html/portal.html b/frontend/html/portal.html index 6c6e730fb8..092dda4725 100644 --- a/frontend/html/portal.html +++ b/frontend/html/portal.html @@ -35,7 +35,7 @@ Espo.require('app-portal', function (App) { var app = new App({ id: '{{portalId}}', - useCache: false, + useCache: {{useCacheInDeveloperMode}}, cacheTimestamp: {{cacheTimestamp}}, url: 'api/v1/portal-access/{{portalId}}', basePath: '{{basePath}}'