useCacheInDeveloperMode

This commit is contained in:
yuri
2017-04-11 12:22:31 +03:00
parent 7afecc4cdd
commit d5cb1f5c1b
3 changed files with 8 additions and 3 deletions

View File

@@ -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;

View File

@@ -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}}'

View File

@@ -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}}'