Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File cached Metadata Exposed Endpoint (but a different cached behavior) #456

Open
DiegoPino opened this issue Jul 26, 2024 · 0 comments
Open
Assignees
Labels
Custom Entities Drupal 10 Upgrade economy enhancement New feature or request Events and Subscribers get 2 printed issues for free IIIF Specs/Manifests/Implementations metadata Meta(l) data Twig Twig template processing
Milestone

Comments

@DiegoPino
Copy link
Member

What?

Most of you might have Twig templates that render in real time and for that the current Drupal based JSON Cached response is actually good enough. But there are a few cases when we need to act differently, specially for Metadata Outputs (JSON or XML) that are of multiple Megabytes and might even take a minute (or two) to build if called over and over in realtime.

The idea here is to enable/allow an extra option that provides a Cache-warmer for endpoints that have this enabled (just a help to speed things up) and a File based Cache (static file generated) that will be served not only "until something changed" and then try to rebuild in realtime (while the user waits for ever- like cache-tag expiration) but actually keep serving an "oldie" until a replacement/via backed/async or shutdown function call was produced. I might even throw a lock here in case multiple concurrent users are calling the same cache-regeneration (basically just hitting an endpoint that needs refreshing)

PHP has actually a method to keep running a method AFTER the response was sent. This one here is actually opinionated but matches Archipelago's very specific deployment (we are already using PHP-FPM) and we could tie this to the

https://www.php.net/manual/en/function.fastcgi-finish-request.php

Another option (maybe a config) would be to simply enqueue the need. And even this fact could be dynamically, we could measure time to produce for a single ADO a cache, if exceeds X time, from there on automatic File caching comes in place.

@alliomeria this is useful for:
39MB (or 40MB) XMLS from EADs
Real, rich, complex IIIF Manifests with hundreds of canvases.

@DiegoPino DiegoPino self-assigned this Jul 26, 2024
@DiegoPino DiegoPino added enhancement New feature or request Twig Twig template processing metadata Meta(l) data IIIF Specs/Manifests/Implementations Custom Entities Drupal 10 Upgrade economy Events and Subscribers get 2 printed issues for free labels Jul 26, 2024
@DiegoPino DiegoPino added this to the 1.5.0 milestone Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Custom Entities Drupal 10 Upgrade economy enhancement New feature or request Events and Subscribers get 2 printed issues for free IIIF Specs/Manifests/Implementations metadata Meta(l) data Twig Twig template processing
Projects
None yet
Development

No branches or pull requests

1 participant