mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 06:56:05 +00:00
fix cache
This commit is contained in:
@@ -32,13 +32,15 @@ var Espo = Espo || {classMap:{}};
|
||||
|
||||
var root = this;
|
||||
|
||||
Espo.Loader = function (cache) {
|
||||
Espo.Loader = function (cache, cacheTimestamp) {
|
||||
this.cache = cache || null;
|
||||
this._loadCallbacks = {};
|
||||
|
||||
this.pathsBeingLoaded = {};
|
||||
|
||||
this.libsConfig = {};
|
||||
|
||||
this.cacheTimestamp = cacheTimestamp || null;
|
||||
}
|
||||
|
||||
_.extend(Espo.Loader.prototype, {
|
||||
@@ -282,9 +284,16 @@ var Espo = Espo || {classMap:{}};
|
||||
}
|
||||
this.pathsBeingLoaded[path] = true;
|
||||
|
||||
var useCache = false;
|
||||
if (this.cacheTimestamp) {
|
||||
useCache = true;
|
||||
var sep = (path.indexOf('?') > -1) ? '&' : '?';
|
||||
path += sep + 'r=' + this.cacheTimestamp;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
cache: false,
|
||||
cache: useCache,
|
||||
dataType: 'text',
|
||||
local: true,
|
||||
url: path,
|
||||
|
||||
@@ -37,7 +37,8 @@
|
||||
Espo.require('app', function (App) {
|
||||
var app = new App({
|
||||
useCache: false,
|
||||
url: '../api/v1',
|
||||
cacheTimestamp: {{cacheTimestamp}},
|
||||
url: '../api/v1'
|
||||
}, function (app) {
|
||||
{{runScript}}
|
||||
});
|
||||
|
||||
@@ -38,7 +38,8 @@
|
||||
var app = new App({
|
||||
id: '{{portalId}}',
|
||||
useCache: false,
|
||||
url: '../api/v1/portal/{{portalId}}',
|
||||
cacheTimestamp: {{cacheTimestamp}},
|
||||
url: '../api/v1/portal/{{portalId}}'
|
||||
}, function (app) {
|
||||
{{runScript}}
|
||||
});
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<link rel="shortcut icon" href="client/img/favicon.ico" type="image/x-icon">
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
Espo.loader.cacheTimestamp = {{cacheTimestamp}};
|
||||
Espo.require('app', function (App) {
|
||||
var app = new App({
|
||||
useCache: {{useCache}},
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<link rel="shortcut icon" href="client/img/favicon.ico" type="image/x-icon">
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
Espo.loader.cacheTimestamp = {{cacheTimestamp}};
|
||||
Espo.require('app-portal', function (App) {
|
||||
var app = new App({
|
||||
id: '{{portalId}}',
|
||||
|
||||
Reference in New Issue
Block a user