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

Redundant call to resource registry API when refreshing cache #1136

Closed
elsand opened this issue Sep 16, 2024 · 0 comments
Closed

Redundant call to resource registry API when refreshing cache #1136

elsand opened this issue Sep 16, 2024 · 0 comments
Assignees
Labels
bug Something isn't working performance Issue related to performance

Comments

@elsand
Copy link
Member

elsand commented Sep 16, 2024

Description

FusionCache(?) calls resource registry twice

Reproduction

  1. Run locally with console logging
  2. Make sure RR cache is empty (in both memory and Redis)
  3. Try to create a dialog
  4. Observe two distinct HTTP requests to the RR endpoint

Image

Expected behavior

The RR API should only be requested once

Actual behavior

The RR API is requested twice

@elsand elsand added the bug Something isn't working label Sep 16, 2024
@elsand elsand added the performance Issue related to performance label Sep 16, 2024
@knuhau knuhau self-assigned this Sep 24, 2024
oskogstad added a commit that referenced this issue Sep 26, 2024
<!--- Provide a general summary of your changes in the Title above -->

## Description

<!--- Describe your changes in detail -->

This is due to the application caching two separate dictionaries of info
from the resource registry, grouped by different keys.

![CleanShot 2024-09-25 at 15 30
41@2x](https://github.com/user-attachments/assets/004eb728-3ed7-46d9-8b22-76f7dd7e6451)

Added caching of the raw response from the resource registry and removed
the dependent caches to lower complexity.

## Related Issue(s)

- #1136 

## Verification

- [x] **Your** code builds clean without any errors or warnings
- [x] Manual testing done (required)
- [ ] Relevant automated test added (if you find this hard, leave it and
we'll help out)

## Documentation

- [ ] Documentation is updated (either in `docs`-directory, Altinnpedia
or a separate linked PR in
[altinn-studio-docs.](https://github.com/Altinn/altinn-studio-docs), if
applicable)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

- **New Features**
- Improved caching strategy for service resource information retrieval,
enhancing performance and efficiency.
- Centralized data fetching logic for service resources, allowing for
more streamlined and efficient access.

- **Bug Fixes**
- Streamlined data fetching logic to minimize unnecessary calls to the
endpoint by utilizing the updated caching mechanism.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Ole Jørgen Skogstad <skogstad@softis.net>
@elsand elsand closed this as completed Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working performance Issue related to performance
Projects
None yet
Development

No branches or pull requests

2 participants