Skip to content

Commit

Permalink
feat: add request caching
Browse files Browse the repository at this point in the history
  • Loading branch information
andrea-deri committed Mar 4, 2024
1 parent 6698d72 commit f5da32f
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 12 deletions.
9 changes: 5 additions & 4 deletions helm/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ microservice-chart:
servicePort: 8080
serviceAccount:
create: false
annotations: {}
annotations: { }
name: ""
podAnnotations: {}
podAnnotations: { }
podSecurityContext:
seccompProfile:
type: RuntimeDefault
Expand Down Expand Up @@ -69,6 +69,7 @@ microservice-chart:
APP_LOGGING_LEVEL: 'DEBUG'
DEFAULT_LOGGING_LEVEL: 'INFO'
CORS_CONFIGURATION: '{"origins": ["*"], "methods": ["*"]}'
CACHE_ENABLED: 'true'
VERIFYKO_COLDSTORAGE_TABLE: 'events'
VERIFYKO_COLDSTORAGE_BLOBCONTAINER: 'payload'
VERIFYKO_HOTSTORAGE_URI: 'https://pagopa-d-weu-nodo-verifyko-cosmos-account.documents.azure.com:443/'
Expand All @@ -95,8 +96,8 @@ microservice-chart:
tenantId: "7788edaf-0346-4068-9d79-c868aed15b3d"
tmpVolumeMount:
create: true
nodeSelector: {}
tolerations: []
nodeSelector: { }
tolerations: [ ]
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down
9 changes: 5 additions & 4 deletions helm/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ microservice-chart:
servicePort: 8080
serviceAccount:
create: false
annotations: {}
annotations: { }
name: ""
podAnnotations: {}
podAnnotations: { }
podSecurityContext:
seccompProfile:
type: RuntimeDefault
Expand Down Expand Up @@ -69,6 +69,7 @@ microservice-chart:
APP_LOGGING_LEVEL: 'INFO'
DEFAULT_LOGGING_LEVEL: 'INFO'
CORS_CONFIGURATION: '{"origins": ["*"], "methods": ["*"]}'
CACHE_ENABLED: 'true'
VERIFYKO_COLDSTORAGE_TABLE: 'events'
VERIFYKO_COLDSTORAGE_BLOBCONTAINER: 'payload'
VERIFYKO_HOTSTORAGE_URI: 'https://pagopa-p-weu-nodo-verifyko-cosmos-account.documents.azure.com:443/'
Expand All @@ -95,8 +96,8 @@ microservice-chart:
tenantId: "7788edaf-0346-4068-9d79-c868aed15b3d"
tmpVolumeMount:
create: true
nodeSelector: {}
tolerations: []
nodeSelector: { }
tolerations: [ ]
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down
9 changes: 5 additions & 4 deletions helm/values-uat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ microservice-chart:
servicePort: 8080
serviceAccount:
create: false
annotations: {}
annotations: { }
name: ""
podAnnotations: {}
podAnnotations: { }
podSecurityContext:
seccompProfile:
type: RuntimeDefault
Expand Down Expand Up @@ -69,6 +69,7 @@ microservice-chart:
APP_LOGGING_LEVEL: 'DEBUG'
DEFAULT_LOGGING_LEVEL: 'INFO'
CORS_CONFIGURATION: '{"origins": ["*"], "methods": ["*"]}'
CACHE_ENABLED: 'true'
VERIFYKO_COLDSTORAGE_TABLE: 'events'
VERIFYKO_COLDSTORAGE_BLOBCONTAINER: 'payload'
VERIFYKO_HOTSTORAGE_URI: 'https://pagopa-u-weu-nodo-verifyko-cosmos-account.documents.azure.com:443/'
Expand All @@ -95,8 +96,8 @@ microservice-chart:
tenantId: "7788edaf-0346-4068-9d79-c868aed15b3d"
tmpVolumeMount:
create: true
nodeSelector: {}
tolerations: []
nodeSelector: { }
tolerations: [ ]
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package it.gov.pagopa.nodoverifykoaux.config;

import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConditionalOnExpression("'${cache.enabled}'=='true'")
@EnableCaching
public class CacheConfig {
}
2 changes: 2 additions & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ logging.level.root=${DEFAULT_LOGGING_LEVEL:INFO}
logging.level.it.gov.pagopa=${APP_LOGGING_LEVEL:INFO}
# CORS configuration
cors.configuration=${CORS_CONFIGURATION:'{"origins": ["*"], "methods": ["*"]}'}
# Caching
cache.enabled=${CACHE_ENABLED:true}
# Application properties
verifyko.cold-storage.connection-string=${VERIFYKO_COLDSTORAGE_CONNECTION}
verifyko.cold-storage.table-name=${VERIFYKO_COLDSTORAGE_TABLE:events}
Expand Down
2 changes: 2 additions & 0 deletions src/test/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ logging.level.root=${DEFAULT_LOGGING_LEVEL:INFO}
logging.level.it.gov.pagopa=${APP_LOGGING_LEVEL:INFO}
# CORS configuration
cors.configuration={"origins": ["*"], "methods": ["*"]}
# Caching
cache.enabled=false
# Application properties
verifyko.cold-storage.connection-string=AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;DefaultEndpointsProtocol=http;BlobEndpoint=http://host.docker.internal:10000/devstoreaccount1;QueueEndpoint=http://host.docker.internal:10001/devstoreaccount1;TableEndpoint=http://host.docker.internal:10002/devstoreaccount1;
verifyko.cold-storage.table-name=events
Expand Down

0 comments on commit f5da32f

Please sign in to comment.