Skip to content

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

Open
jhamman wants to merge 2 commits into
xpublish-community:mainfrom
jhamman:feature/fastapi-cache
Open

feature(cache): explore using fastapi-cache to cache responses#45
jhamman wants to merge 2 commits into
xpublish-community:mainfrom
jhamman:feature/fastapi-cache

Conversation

@jhamman
Copy link
Copy Markdown
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
Copy Markdown
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