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

feature(cache): explore using fastapi-cache to cache responses #45

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jhamman
Copy link
Contributor

@jhamman jhamman commented Aug 7, 2024

This is an alternative to #42 and one that aligns much closer with @mpiannucci's comment in #40 (comment).

TODOs:

  • figure out how to support plugable fastapi-cache backends (or no caching at all)
  • add tests

@jhamman jhamman mentioned this pull request Aug 7, 2024
@abkfenris
Copy link
Member

I'd probably add a cache_uri parameter to the plugin to configure cache type and connection information.

class CfEdrPlugin(Plugin): 
     """ 
     OGC EDR compatible endpoints for Xpublish datasets 
     """ 
  
     name: str = "cf_edr" 
  
     ...

    cache_uri: Optional[str] = None  # could be 'inmemory', 'redis://...'

But it might be something that would be better to have as a top level Xpublish dependency and configuration option, then all plugins can take advantage of it (at least for formats where CDNs make sense).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants