Skip to content

Commit

Permalink
Merge pull request #879 from girder/better-cache-control
Browse files Browse the repository at this point in the history
Use the girder client build time for cache control.
  • Loading branch information
manthey authored Jun 29, 2022
2 parents d497266 + 4cf9795 commit 05dabf2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## 1.15.1

### Improvements
- When scaling heatmap annoations, use an appropriate value ([878](../../pull/878))
- Use the girder client build time for cache control ([879](../../pull/879))

## 1.15.0

### Features
Expand Down
3 changes: 2 additions & 1 deletion girder/girder_large_image/web_client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"hammerjs": "^2.0.8",
"js-yaml": "^3.14.0",
"sinon": "^2.1.0",
"slideatlas-viewer": "^4.4.1"
"slideatlas-viewer": "^4.4.1",
"webpack": "^2.7.0"
},
"main": "./index.js",
"girderPlugin": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* global BUILD_TIMESTAMP */

import $ from 'jquery';
import _ from 'underscore';
// Import hammerjs for geojs touch events
Expand Down Expand Up @@ -42,7 +44,7 @@ var GeojsImageViewerWidget = ImageViewerWidget.extend({
return this;
}),
$.ajax({ // like $.getScript, but allow caching
url: root + '/plugins/large_image/extra/geojs.js',
url: root + '/plugins/large_image/extra/geojs.js' + (BUILD_TIMESTAMP ? '?_=' + BUILD_TIMESTAMP : ''),
dataType: 'script',
cache: true
}))
Expand Down
7 changes: 7 additions & 0 deletions girder/girder_large_image/web_client/webpack.helper.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const path = require('path');

const webpack = require('webpack');

const CopyWebpackPlugin = require('copy-webpack-plugin');

module.exports = function (config) {
Expand All @@ -16,5 +18,10 @@ module.exports = function (config) {
to: path.join(config.output.path, 'extra', 'sinon.js')
}])
);
config.plugins.push(
new webpack.DefinePlugin({
BUILD_TIMESTAMP: Date.now()
})
);
return config;
};

0 comments on commit 05dabf2

Please sign in to comment.