HTTP Cache service using environment variable
This commit is contained in:
@@ -179,7 +179,8 @@ Available languages:
|
|||||||
| MIFOS_DEFAULT_CHAR_DELIMITER | Character delimiter for CSV exports | , |
|
| MIFOS_DEFAULT_CHAR_DELIMITER | Character delimiter for CSV exports | , |
|
||||||
| MIFOS_WAIT_TIME_FOR_NOTIFICATIONS | Wait time in seconds for reading notifications | 60 |
|
| MIFOS_WAIT_TIME_FOR_NOTIFICATIONS | Wait time in seconds for reading notifications | 60 |
|
||||||
| MIFOS_WAIT_TIME_FOR_CATCHUP | Wait time in seconds for reading COB Catch-Up status | 30 |
|
| MIFOS_WAIT_TIME_FOR_CATCHUP | Wait time in seconds for reading COB Catch-Up status | 30 |
|
||||||
| MIFOS_MIN_PASSWORD_LENGTH | WMinimum length for user passwords | 12 |
|
| MIFOS_MIN_PASSWORD_LENGTH | Minimum length for user passwords | 12 |
|
||||||
|
| MIFOS_HTTP_CACHE_ENABLED | whether to use HTTP Get calls with cache | false |
|
||||||
|
|
||||||
#### UI Display Settings
|
#### UI Display Settings
|
||||||
|
|
||||||
|
|||||||
@@ -29,3 +29,6 @@ MIFOS_OAUTH_SERVER_URL=https://{$URL_OAUTH_SERVER}
|
|||||||
|
|
||||||
#Set the application client id, only used while Oauth is enabled
|
#Set the application client id, only used while Oauth is enabled
|
||||||
MIFOS_OAUTH_CLIENT_ID=web-app
|
MIFOS_OAUTH_CLIENT_ID=web-app
|
||||||
|
|
||||||
|
#Enable or Disable HTTP Cache
|
||||||
|
MIFOS_HTTP_CACHE_ENABLED=true
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { Observable, Subscriber } from 'rxjs';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { HttpCacheService } from './http-cache.service';
|
import { HttpCacheService } from './http-cache.service';
|
||||||
|
import { environment } from 'environments/environment';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Caches HTTP requests.
|
* Caches HTTP requests.
|
||||||
@@ -45,7 +46,7 @@ export class CacheInterceptor implements HttpInterceptor {
|
|||||||
} else {
|
} else {
|
||||||
next.handle(request).subscribe(
|
next.handle(request).subscribe(
|
||||||
(event) => {
|
(event) => {
|
||||||
if (event instanceof HttpResponse) {
|
if (environment.httpCacheEnabled && event instanceof HttpResponse) {
|
||||||
this.httpCacheService.setCacheData(request.urlWithParams, event);
|
this.httpCacheService.setCacheData(request.urlWithParams, event);
|
||||||
}
|
}
|
||||||
subscriber.next(event);
|
subscriber.next(event);
|
||||||
|
|||||||
-1
@@ -252,7 +252,6 @@
|
|||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
<button
|
<button
|
||||||
mat-button
|
|
||||||
*ngIf="loanProductSettingsForm.controls.delinquencyBucketId"
|
*ngIf="loanProductSettingsForm.controls.delinquencyBucketId"
|
||||||
matSuffix
|
matSuffix
|
||||||
mat-icon-button
|
mat-icon-button
|
||||||
|
|||||||
@@ -47,6 +47,9 @@
|
|||||||
// Min Password length
|
// Min Password length
|
||||||
window['env']['minPasswordLength'] = '$MIFOS_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']['vNextApiUrl'] = '$VNEXT_API_URL';
|
||||||
window['env']['vNextApiProvider'] = '$VNEXT_API_PROVIDER';
|
window['env']['vNextApiProvider'] = '$VNEXT_API_PROVIDER';
|
||||||
window['env']['vNextApiVersion'] = '$VNEXT_API_VERSION';
|
window['env']['vNextApiVersion'] = '$VNEXT_API_VERSION';
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ export const environment = {
|
|||||||
idleTimeout: loadedEnv['sessionIdleTimeout'] || 300000 // 5 minutes
|
idleTimeout: loadedEnv['sessionIdleTimeout'] || 300000 // 5 minutes
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
httpCacheEnabled: loadedEnv.httpCacheEnabled || false,
|
||||||
|
|
||||||
vNextApiUrl: window['env']['vNextApiUrl'] || 'https://apis.mifos.community',
|
vNextApiUrl: window['env']['vNextApiUrl'] || 'https://apis.mifos.community',
|
||||||
vNextApiProvider: window['env']['vNextApiProvider'] || '/vnext1',
|
vNextApiProvider: window['env']['vNextApiProvider'] || '/vnext1',
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ export const environment = {
|
|||||||
idleTimeout: loadedEnv.sessionIdleTimeout || 300000 // 5 minutes
|
idleTimeout: loadedEnv.sessionIdleTimeout || 300000 // 5 minutes
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
httpCacheEnabled: loadedEnv.httpCacheEnabled || false,
|
||||||
|
|
||||||
vNextApiUrl: window.env?.vNextApiUrl || 'https://apis.flexcore.mx',
|
vNextApiUrl: window.env?.vNextApiUrl || 'https://apis.flexcore.mx',
|
||||||
vNextApiProvider: window.env?.vNextApiProvider || '/vnext1',
|
vNextApiProvider: window.env?.vNextApiProvider || '/vnext1',
|
||||||
|
|||||||
Reference in New Issue
Block a user