HTTP Cache service using environment variable

This commit is contained in:
Jose Alberto Hernandez
2025-06-17 14:10:07 -05:00
parent cff21a746a
commit 8de8a1fdef
7 changed files with 12 additions and 3 deletions
+2 -1
View File
@@ -7,6 +7,7 @@ import { Observable, Subscriber } from 'rxjs';
/** Custom Services */
import { HttpCacheService } from './http-cache.service';
import { environment } from 'environments/environment';
/**
* Caches HTTP requests.
@@ -45,7 +46,7 @@ export class CacheInterceptor implements HttpInterceptor {
} else {
next.handle(request).subscribe(
(event) => {
if (event instanceof HttpResponse) {
if (environment.httpCacheEnabled && event instanceof HttpResponse) {
this.httpCacheService.setCacheData(request.urlWithParams, event);
}
subscriber.next(event);
@@ -252,7 +252,6 @@
</mat-option>
</mat-select>
<button
mat-button
*ngIf="loanProductSettingsForm.controls.delinquencyBucketId"
matSuffix
mat-icon-button
+3
View File
@@ -47,6 +47,9 @@
// Min Password length
window['env']['minPasswordLength'] = '$MIFOS_MIN_PASSWORD_LENGTH';
// Enable or Disable HTTP Cache
window['env']['httpCacheEnabled'] = '$MIFOS_HTTP_CACHE_ENABLED';
window['env']['vNextApiUrl'] = '$VNEXT_API_URL';
window['env']['vNextApiProvider'] = '$VNEXT_API_PROVIDER';
window['env']['vNextApiVersion'] = '$VNEXT_API_VERSION';
+1
View File
@@ -53,6 +53,7 @@ export const environment = {
idleTimeout: loadedEnv['sessionIdleTimeout'] || 300000 // 5 minutes
}
},
httpCacheEnabled: loadedEnv.httpCacheEnabled || false,
vNextApiUrl: window['env']['vNextApiUrl'] || 'https://apis.mifos.community',
vNextApiProvider: window['env']['vNextApiProvider'] || '/vnext1',
+1
View File
@@ -57,6 +57,7 @@ export const environment = {
idleTimeout: loadedEnv.sessionIdleTimeout || 300000 // 5 minutes
}
},
httpCacheEnabled: loadedEnv.httpCacheEnabled || false,
vNextApiUrl: window.env?.vNextApiUrl || 'https://apis.flexcore.mx',
vNextApiProvider: window.env?.vNextApiProvider || '/vnext1',