AppFolio API 性能调优 是做什么的?
性能策略
| 策略 | 节省效果 | 实现方式 |
|---|---|---|
| 响应缓存 | API 调用减少 60-80% | 缓存属性/单元(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 };
}