Skip to content

maxage not working with $http and localstorage with passive deleteOnExpire setting  #224

@ekallevig

Description

@ekallevig

I'm using angular-cache with $http and localStorage. I use a maxAge and "passive" setting for deleteOnExpire. The caching works fine, but after exceeding the maxAge time (expired), it continues to fetch from cache. If I change deleteOnExpire to 'aggressive', it works as expected (fetches from server after maxAge has elapsed). When I switch it back to memory storageMode (with passive), it works as expected (after item expires, it fetches from server).

My reading of the docs was that passive simply means it doesn't clear the expired value until the cache is requested again (vs aggressive, where it clears it the second the maxAge has elapsed).

Am I doing something wrong or is this expected?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions