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

Cache new response if successful #1322

Merged
merged 2 commits into from
Jul 28, 2023
Merged

Cache new response if successful #1322

merged 2 commits into from
Jul 28, 2023

Conversation

Ajeyakrishna-k
Copy link
Contributor

@Ajeyakrishna-k Ajeyakrishna-k commented Jul 24, 2023

Fixes: #1305

Description:
For caching:

  1. This PR adds a check to verify if the controller layer sets the status code in the range 2xx before caching the response.

For Invalidation:

  1. Currently we were invalidating the cache before passing the control to controller function.
  2. This PR makes necessary changes to make the invalidation after the controller function is executed. It also makes sure the call was successful by checking the status code.

Test coverage:
Screenshot 2023-07-24 at 9 33 09 PM

No DB changes

@Ajeyakrishna-k Ajeyakrishna-k changed the title Fix/cache success Cache new response iff successful Jul 24, 2023
@Ajeyakrishna-k Ajeyakrishna-k marked this pull request as ready for review July 24, 2023 16:09
@Ajeyakrishna-k Ajeyakrishna-k self-assigned this Jul 24, 2023
@iamitprakash
Copy link
Member

@RitikJaiswal75 can you please look here once

@yesyash yesyash changed the title Cache new response iff successful Cache new response if successful Jul 24, 2023
Copy link
Contributor

@RitikJaiswal75 RitikJaiswal75 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking the time and explaining it over the call.

@ankushdharkar ankushdharkar merged commit 69bf555 into develop Jul 28, 2023
3 checks passed
@ankushdharkar ankushdharkar deleted the fix/cache-success branch July 28, 2023 01:41
@Ajeyakrishna-k Ajeyakrishna-k mentioned this pull request Jul 28, 2023
8 tasks
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.

Cache new response iff successful
5 participants