AppFolio 效能調校
效能策略
| 策略 | 節省幅度 | 實作方式 |
|---|---|---|
| 回應快取 | 減少 60-80% API 呼叫 | 快取屬性/單元(TTL 5 分鐘) |
| 並行請求 | 儀表板載入快 3-5 倍 | 使用 Promise.all 處理獨立端點 |
| 增量同步 | 減少 70% 資料傳輸 | 追蹤 last_modified 時間戳記 |
平行儀表板擷取
async function loadDashboard() {
const [properties, tenants, leases, units] = await Promise.all([
client.http.get("/properties"),
client.http.get("/tenants"),
client.http.get("/leases"),
client.http.get("/units"),
]);
return { properties: properties.data, tenants: tenants.data, leases: leases.data, units: units.data };
}