Merge pull request #4132 from cp2004/improve/pgmr-cache-no-render

⚡ Don't re-render the plugin repository if notmodified
This commit is contained in:
Gina Häußge authored and GitHub committed 2021-05-11 16:56:54 +02:00
commit 0ad9690abd
1 file changed
+6 -2
@@ -693,11 +693,15 @@ $(function () {
}
OctoPrint.plugins.pluginmanager
.getRepository(!!options.refresh)
.getRepository(!!options.refresh, {ifModified: true})
.fail(function () {
deferred.reject();
})
.done(function (data) {
.done(function (data, status, xhr) {
// Don't update if cached - requires ifModified: true to pass through
// the 304 status, otherwise it fakes it and produces 200 all the time.
if (xhr.status === 304) return;
self.fromRepositoryResponse(data.repository);
self.online(data.online !== undefined ? data.online : true);
deferred.resolveWith(data);