Skip to content

Commit 63b7263

Browse files
committed
don't allow the browser to cache requests that we are going to cache
manually, to work around some issues with cache persistence
1 parent cc8e23a commit 63b7263

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/eve-ui.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -1209,6 +1209,10 @@ namespace eveui {
12091209
function cache_request( key: string ): JQueryPromise<any> {
12101210
let url: string;
12111211
let jsonp = false;
1212+
let custom_cache =
1213+
key.startsWith( '/v3/universe/types' )
1214+
|| key.startsWith( '/v1/dogma/attributes' )
1215+
|| key.startsWith( 'osmium' );
12121216

12131217
if ( key.startsWith( 'osmium:' ) ) {
12141218
jsonp = true;
@@ -1237,7 +1241,7 @@ namespace eveui {
12371241
url,
12381242
{
12391243
dataType: dataType,
1240-
cache: true,
1244+
cache: ! custom_cache, // if this request is not going to be cached manually, allow the browser to cache it
12411245
}
12421246
).done(
12431247
function( data ) {
@@ -1248,11 +1252,7 @@ namespace eveui {
12481252

12491253
if ( db ) { // indexedDB is ready
12501254
// only manually cache keypaths where the data doesn't change until the server version changes
1251-
if (
1252-
key.startsWith( '/v3/universe/types' )
1253-
|| key.startsWith( '/v1/dogma/attributes' )
1254-
|| key.startsWith( 'osmium' )
1255-
) {
1255+
if ( custom_cache ) {
12561256
let tx = db.transaction( 'cache', 'readwrite' );
12571257
let store = tx.objectStore( 'cache' );
12581258
store.put( data );

0 commit comments

Comments
 (0)