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

Enable caching on authorized resources #578

Open
cavis opened this issue Dec 11, 2020 · 1 comment
Open

Enable caching on authorized resources #578

cavis opened this issue Dec 11, 2020 · 1 comment

Comments

@cavis
Copy link
Member

cavis commented Dec 11, 2020

Currently we have caching disabled for everything under /api/v1/authorization. Though the Authorization model does define a cache key that should work ... hashing your token-auth account ids.

Should consider enabling caching there. But it's not entirely straightforward. Using Publish/CMS locally, I saw a lot of 500s coming from hal_api-rails with caching enabled. Appears to be endpoints that manually set the hal_api-rails instance variables. For instance:

class Api::Auth::SeriesController < Api::SeriesController
  def resources_base
    @series ||= authorization.token_auth_series
  end
end

This doesn't appear to play well with kaminari, as we haven't decorated that @series with paging (or anything else). Maybe this is just the wrong way to override resources base?

But even after cleaning those up, still saw some other bugs pop up. May take some work to track those all down.

@cavis
Copy link
Member Author

cavis commented Dec 14, 2020

There are some other things we'd like to try first: #577 and/or upgrading Roar, etc.

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

No branches or pull requests

1 participant