Skip to content

Commit

Permalink
YDA-5956: experimental support for response and API caching
Browse files Browse the repository at this point in the history
  • Loading branch information
lwesterhof committed Mar 4, 2025
1 parent 5b75f2f commit 0b360ad
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docker/images/yoda_portal/yoda_portal_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ DATAREQUEST_ENABLED = True
TOKENS_ENABLED = True
TOKEN_LIFETIME = 72
SRAM_ENABLED = False
CACHING_ENABLED = False
# Logging configuration
LOG_API_CALL_DURATION = True
Expand Down Expand Up @@ -206,7 +207,7 @@ UPLOAD_PART_FILES = True
TEXT_FILE_EXTENSIONS = ['bash', 'csv', 'c', 'cpp', 'csharp', 'css', 'diff', 'fortran', 'gams', 'gauss', 'go', 'graphql', 'ini', 'irpf90', 'java', 'js', 'json', 'julia', 'julia-repl', 'kotlin', 'less', 'lua', 'makefile', 'markdown', 'md', 'mathematica', 'matlab', 'maxima', 'mizar', 'objectivec', 'openscad', 'perl', 'php', 'php-template', 'plaintext', 'txt', 'python', 'py', 'python-repl', 'r', 'ruby', 'rust', 'sas', 'scilab', 'scss', 'shell', 'sh', 'sql', 'stan', 'stata', 'swift', 'typescript', 'ts', 'vbnet', 'wasm', 'xml', 'yaml', 'html']
# Monitor thread configuration
MONITOR_OUTPUT_DIR = "/tmp"
MONITOR_OUTPUT_DIR = "/tmp"
MONITOR_SIGNAL_FILE = "/var/www/yoda/show-tech.sig"
FLASKCFG
Expand Down
5 changes: 4 additions & 1 deletion roles/yoda_portal/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ yoda_theme_mapping:
wur: "Wageningen University & Research"

# Yoda portal
yoda_portal_version: "{{ yoda_version }}"
yoda_portal_version: "portal-caching"
yoda_portal_log_api_call_duration: false
yoda_portal_path: /var/www/yoda # Path to location of portal
yoda_config_path: '/var/www/yoda/config' # Path to portal's shared configuration
Expand Down Expand Up @@ -84,6 +84,9 @@ token_lifetime: 72 # Lifetime of data access tok
# SRAM Configuration
enable_sram: false # Enable SRAM configuration

# Portal caching
enable_portal_caching: false

# Apache timeout for Yoda portal vhost in seconds
yoda_portal_timeout: 60

Expand Down
2 changes: 2 additions & 0 deletions roles/yoda_portal/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ dependencies:
- role: apache
- role: apache_wsgi
- role: certificates
- role: redis
when: "enable_portal_caching"
1 change: 1 addition & 0 deletions roles/yoda_portal/templates/flask.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ DATAREQUEST_ENABLED = {{ enable_datarequest }}
TOKENS_ENABLED = {{ enable_tokens }}
TOKEN_LIFETIME = {{ token_lifetime }}
SRAM_ENABLED = {{ enable_sram }}
CACHING_ENABLED = {{ enable_portal_caching }}

# Logging configuration
LOG_API_CALL_DURATION = {{ yoda_portal_log_api_call_duration }}
Expand Down

0 comments on commit 0b360ad

Please sign in to comment.