immobiliare / backstage-plugin-gitlab

Backstage plugins to interact with GitLab
Apache License 2.0
108 stars 33 forks source link

Add request caching with low TTL #32

Open antoniomuso opened 1 year ago

antoniomuso commented 1 year ago

We can add request caching with a lower TTL to reduce the number of duplicated requests.

This should also be done by caching the stale responses.

JellyBellyDev commented 1 year ago

Good, but I think this has higher priority #7, no?

antoniomuso commented 1 year ago

Yes, it has, but #7 is the more complicated feature because it depends on #8 , And to do this, we have to create a backend part for this plugin with a Processor. The Processor should enrich the component with the GitLab project-id.

JellyBellyDev commented 1 year ago

@antoniomuso all clear, thank you

simonecorsi commented 1 year ago

This could benefit from an LRU cache instead of a fixed for all TTL!

antoniomuso commented 1 year ago

I am just thinking of simply changing the cache policy of fetch https://developer.mozilla.org/en-US/docs/Web/API/Request/cache#value

Parsifal-M commented 1 year ago

I am just thinking of simply changing the cache policy of fetch https://developer.mozilla.org/en-US/docs/Web/API/Request/cache#value

Which did you have in mind? Could possibly help out with this 👍

antoniomuso commented 1 year ago

Now that we have the backend part, we can handle caching from the server side. This can be done by changing the cache-control header with TTL equal to 0 with a TTL of 10 seconds. We can also allow the user to configure a custom TTL in the app-config.yaml.

github-actions[bot] commented 8 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.