redi_cache 1.0 KB

123456789101112131415161718192021
  1. * request
  2. * check if $requestURI + etag in cache -> return
  3. * download gtfs-rt trips + vehicles ->
  4. * check if in cache -> use
  5. * if headers have valid-to/from+for -> set ${feedID}/${type}ValidTo ${validTo} ; disappearing at $validity
  6. * else -> set ${feedID}/${type}ValidTo $($(now)+30s) ; disappearing at $validity
  7. * save pb to ${feedID}/trips and ${feedID}/vehicles ; disappearing at $validity
  8. * or hash map from above
  9. * download stop from API ->
  10. * check if in cache -> use
  11. * if headers have valid-to/from+for validity from headers
  12. * else -> validity $($(now)+30s)
  13. * save response ; disappearing at $validity
  14. * download alerts
  15. * check if in cache -> use
  16. * if headers have valid-to/from+for -> set ${feedID}/${type}ValidTo ${validTo} ; disappearing at $validity
  17. * else -> set ${feedID}/${type}ValidTo $($(now)+30s) ; disappearing at $validity
  18. * save pb to ${feedID}/trips and ${feedID}/vehicles ; disappearing at $validity
  19. * or hash map from above
  20. * set ${requestURI} "${etag} ${validity} $(${payload}|base64)" ; disappearing at $validity