Question
$http Service Caching in AngularJS 1.8.2: Missing Timeout Constraint for Stale Data During Migration
Lax Sage
0 reputation · 19 Oct 2024, 14:23 UTC
84.3K views0
Caching behavior of $http in AngularJS 1.8.2
When a small AngularJS application is migrated live, the $http service’s built‑in caching can return stale responses if the server data changes between requests. The cache is populated automatically when cache:true is set, but there is no built‑in timeout or invalidation policy.
Unresolved Decision Point
To avoid downtime, the application must keep the UI in sync with the server after migration. The missing constraint is a mechanism to expire or refresh cached entries after a configurable period or event.
Key Questions
- What is the best approach to enforce a timeout or conditional revalidation on $http cache entries in AngularJS 1.8.2?
- Can a custom interceptor reliably track and invalidate stale cache entries without affecting performance during a live migration?
- Are there third‑party libraries that provide TTL support for $http caching compatible with AngularJS 1.8.2?