Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

Configure $http.get usages to cache #923

Merged
merged 2 commits into from
Feb 17, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ and this project adheres to
Versions in this document should match those
[published to Sonatype Maven Central Repository][].

## Next

+ Configure usages of `$http.get` to cache.
Previously some usages did not turn on caching.

## 12.0.0 - 2021-02-05

**Breaking change: "silent" login is no longer a thing.**
Expand Down
9 changes: 5 additions & 4 deletions web/src/main/webapp/my-app/layout/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ define(['angular', 'jquery'], function(angular, $) {
};

// no caching... request from the server
return $http.get(SERVICE_LOC.context + SERVICE_LOC.layout)
return $http.get(SERVICE_LOC.context + SERVICE_LOC.layout, {cache: true} )
.then(successFn, errorFn);
};

Expand Down Expand Up @@ -207,13 +207,14 @@ define(['angular', 'jquery'], function(angular, $) {
};

// no caching... request from the server
return $http.get(SERVICE_LOC.context + SERVICE_LOC.layout)
return $http.get(
SERVICE_LOC.context + SERVICE_LOC.layout, {cache: true} )
.then(successFn, errorFn);
});
};

var getApp = function(fname) {
return $http.get(SERVICE_LOC.base + 'portlet/' +fname + '.json')
return $http.get(SERVICE_LOC.base + 'portlet/' +fname + '.json', {cache: true})
.then(
function(result) {
return result;
Expand Down Expand Up @@ -335,7 +336,7 @@ define(['angular', 'jquery'], function(angular, $) {
// run that through an RSS to JSON converter.
// Whereas this hack repurposes existing configuration for (3)
// to do (1).
return $http.get(feedURL);
return $http.get(feedURL, {cache: true});
};

return {
Expand Down
4 changes: 2 additions & 2 deletions web/src/main/webapp/my-app/marketplace/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ define(['angular', 'jquery'], function(angular, $) {

var getUserRating = function(fname) {
return $http.get(SERVICE_LOC.base + SERVICE_LOC.marketplace.base +
fname + '/getRating')
fname + '/getRating', {cache: true})
.then(function(result) {
return result.data.rating;
});
Expand Down Expand Up @@ -305,7 +305,7 @@ define(['angular', 'jquery'], function(angular, $) {
return $http.get(
SERVICE_LOC.base +
SERVICE_LOC.marketplace.base + fname +
'/ratings')
'/ratings', {cache: true})
.then(function(result) {
return result.data.ratings;
});
Expand Down
4 changes: 2 additions & 2 deletions web/src/main/webapp/my-app/search/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ define(['angular', 'jquery'], function(angular, $) {
return getGoogleSearchURL().then(function(googleSearchURL) {
return $q(function(resolve, reject) {
if (googleSearchURL) {
return $http.get(googleSearchURL + '&q=' + term).then(
return $http.get(googleSearchURL + '&q=' + term, {cache: true}).then(
function(response) {
var data = {
results: null,
Expand Down Expand Up @@ -327,7 +327,7 @@ define(['angular', 'jquery'], function(angular, $) {
return getDirectorySearchURL().then(function(searchDirectoryURL) {
return $q(function(resolve, reject) {
if (searchDirectoryURL) {
return $http.get(searchDirectoryURL + '/?name=' + term).then(
return $http.get(searchDirectoryURL + '/?name=' + term, {cache: true}).then(
function(response) {
return resolve(response.data);
},
Expand Down