Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

$http : ability to clear a request from the cache #5968 #6334

Closed
wants to merge 1 commit into from

Conversation

njs50
Copy link

@njs50 njs50 commented Feb 19, 2014

Previously it was not possible to remove data from $http cache (without duplicating internal functions in http to calculate the key used, which could change in the future...).

feat($http): change $http to allow removing/replacing individual requests in $http cache

Adds $http.removeCache method.
Adds/implements replaceCache property in $http request configuration.

Closes #5968

@mary-poppins
Copy link

Thanks for the PR! Please check the items below to help us merge this faster. See the contributing docs for more information.

  • Uses the issue template (#6334)

If you need to make changes to your pull request, you can update the commit with git commit --amend.
Then, update the pull request with git push -f.

Thanks again for your help!

@caitp
Copy link
Contributor

caitp commented Feb 19, 2014

Is this really needed? You can already do this with $cacheFactory

@njs50
Copy link
Author

njs50 commented Feb 19, 2014

yes, as there is no way to be sure you have the correct key for the cache
that is returned from $cacheFactory.

On Wed, Feb 19, 2014 at 6:37 PM, Caitlin Potter notifications@github.comwrote:

Is this really needed? You can already do this with $cacheFactory

Reply to this email directly or view it on GitHubhttps://github.com//pull/6334#issuecomment-35467930
.

@mary-poppins
Copy link

I'm sorry, but I wasn't able to verify your Contributor License Agreement (CLA) signature. CLA signature is required for any code contributions to AngularJS.

Please sign our CLA and ensure that the CLA signature email address and the email address in this PR's commits match.

If you signed the CLA as a corporation, please let us know the company's name.

Thanks a bunch!

PS: If you signed the CLA in the past then most likely the email addresses don't match. Please sign the CLA again or update the email address in the commit of this PR.
PS2: If you are a Googler, please sign the CLA as well to simplify the CLA verification process.

@njs50 njs50 added cla: no and removed cla: yes labels Feb 19, 2014
@njs50
Copy link
Author

njs50 commented Feb 19, 2014

CLA is signed as Dell Inc

@njs50 njs50 added cla: no and removed cla: yes labels Feb 20, 2014
@njs50 njs50 added cla: no and removed cla: yes labels Feb 21, 2014
@njs50
Copy link
Author

njs50 commented Feb 25, 2014

Is there something else I should be doing to update my CLA status?

@njs50 njs50 added cla: no and removed cla: yes labels Feb 26, 2014
@njs50
Copy link
Author

njs50 commented Mar 17, 2014

I also signed an individual CLA and switched my email address on this to match. Maybe that well help?

@btford btford added this to the Backlog milestone Mar 17, 2014
@mary-poppins
Copy link

CLA signature verified! Thank you!

Someone from the team will now triage your PR and it will be processed based on the determined priority (doc updates and fixes with tests are prioritized over other changes).

…ests in $http cache

Adds $http.removeCache method.
Adds/implements replaceCache property in $http request configuration.

Closes angular#5968

var url = buildUrl(config.url, config.params);

var cache = isObject(config.cache) ? config.cache
Copy link
Member

Choose a reason for hiding this comment

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

Maybe this should be moved into a reusable function.

@gkalpak
Copy link
Member

gkalpak commented Jun 17, 2016

I would like to see more tests (e.g. that the correct cache is cleared, that params are taken into account when determining the cache key etc).
Other than that, it is reasonable and a useful feature imo.

@njs50
Copy link
Author

njs50 commented Jun 20, 2016

I didn't even realise this PR was still around (opened feb 2014). I'm just going to close it and if someone still wants this functionality they can open it up again and update it.

@njs50 njs50 closed this Jun 20, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

$http : ability to clear a request from the cache
7 participants