Skip to content

Commit

Permalink
Merge pull request #666 from girder/tile-caching
Browse files Browse the repository at this point in the history
Better handle item changes with tile caching
  • Loading branch information
manthey authored Oct 7, 2021
2 parents 1b8f663 + 7ab1889 commit 6919669
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## Version 1.8.3

### Improvements
- Better handle item changes with tile caching (#666)

## Version 1.8.2

### Improvements
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ import View from '@girder/core/views/View';
var ImageViewerWidget = View.extend({
initialize: function (settings) {
this.itemId = settings.itemId;
let item = (settings.model || {}).attributes || {};
this.updated = item.updated || item.created;
if (this.updated) {
this.updated = this.updated.replace(/:/g, '-').replace(/\+/g, '_');
}
// optional query parameters, such as {encoding: 'PNG'}, may be
// undefined or null
this.tileQueryDefaults = settings.tileQueryDefaults;
Expand Down Expand Up @@ -39,6 +44,9 @@ var ImageViewerWidget = View.extend({
}
var url = getApiRoot() + '/item/' + this.itemId + '/tiles/zxy/' +
level + '/' + x + '/' + y;
if (this.updated) {
query = $.extend({_: this.updated}, query);
}
if (query) {
url += '?' + $.param(query);
}
Expand Down

0 comments on commit 6919669

Please sign in to comment.