refactor: remove client-side cache key pulls

This commit is contained in:
Shivam Mishra
2026-06-10 12:37:11 +05:30
parent f452b88e8d
commit 0b4d1c801c
6 changed files with 9 additions and 85 deletions
@@ -50,12 +50,11 @@ class CacheEnabledApiClient extends ApiClient {
return this.getFromNetwork();
}
// Trust the IDB cache. Freshness is maintained by:
// - boot-time hydrateStoresFromCache (compares server keys once on boot)
// - ActionCable ACCOUNT_CACHE_INVALIDATED broadcasts (live updates)
// - ReconnectService.revalidateCaches (on WebSocket reconnect)
// Skipping the per-call /cache_keys preflight eliminates N GET requests per
// cold settings-page load.
// Trust the IDB cache. Freshness is maintained by the
// account.cache_invalidated event alone: RoomChannel pushes the cache-key
// map on every (re)subscribe — boot and reconnect included — and the
// server broadcasts it on every change. Skipping a per-call /cache_keys
// preflight eliminates N GET requests per cold settings-page load.
const localData = await this.dataManager.get({
modelName: this.cacheModelName,
});
-7
View File
@@ -9,13 +9,6 @@ class AccountAPI extends ApiClient {
createAccount(data) {
return axios.post(`${this.apiVersion}/accounts`, data);
}
async getCacheKeys() {
const response = await axios.get(
`/api/v1/accounts/${this.accountIdFromRoute}/cache_keys`
);
return response.data.cache_keys;
}
}
export default new AccountAPI();