硬编码类别或从 API 中获取

Hard-Coding Categories or Fetching from API

推荐的获取CategoryIds的方法是什么。我知道 Foursquare 提供了这个列表:https://developer.foursquare.com/categorytree。我的问题是我应该只使用此列表并对值进行硬编码还是在首次打开应用程序时获取 ID 并缓存这些结果?

来自 venues/categories API 文档:

When designing client applications, please download this list only once per session, but also avoid caching this data for longer than a week to avoid stale information.

因此在应用程序启动时获取并缓存当前会话以确保层次结构始终是最新的。