Skip to content

Commit

Permalink
Merge pull request #4132 from cp2004/improve/pgmr-cache-no-render
Browse files Browse the repository at this point in the history
⚡ Don't re-render the plugin repository if notmodified
  • Loading branch information
foosel authored May 11, 2021
2 parents fa8d4f7 + e403e8c commit 0ad9690
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0ad9690

Please sign in to comment.