backstage-plugin-gitlab icon indicating copy to clipboard operation
backstage-plugin-gitlab copied to clipboard

Add request caching with low TTL

Open antoniomuso opened this issue 3 years ago • 9 comments

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.

antoniomuso avatar Jan 12 '23 10:01 antoniomuso

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

JellyBellyDev avatar Jan 12 '23 15:01 JellyBellyDev

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.

antoniomuso avatar Jan 12 '23 15:01 antoniomuso

@antoniomuso all clear, thank you

JellyBellyDev avatar Jan 12 '23 16:01 JellyBellyDev

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

simonecorsi avatar Jan 17 '23 15:01 simonecorsi

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

antoniomuso avatar Jan 17 '23 15:01 antoniomuso

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 👍

Parsifal-M avatar Feb 27 '23 07:02 Parsifal-M

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.

antoniomuso avatar Feb 27 '23 08:02 antoniomuso

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.

github-actions[bot] avatar Jan 05 '24 02:01 github-actions[bot]

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.

github-actions[bot] avatar Sep 28 '24 02:09 github-actions[bot]

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.

github-actions[bot] avatar Oct 29 '24 02:10 github-actions[bot]