Skip to content
This repository was archived by the owner on Sep 29, 2025. It is now read-only.

Commit 5a844ae

Browse files
committed
chore(cache): increase cache duration for station data
setting the cache to 1 hour seems like a good balance between performance and data freshness.
1 parent ef4622c commit 5a844ae

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pems_data/src/pems_data/services/stations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def get_district_metadata(self, district_number: str) -> pd.DataFrame:
4343
def get_imputed_agg_5min(self, station_id: str) -> pd.DataFrame:
4444
"""Loads imputed aggregate 5 minute data for a specific station."""
4545

46-
cache_opts = {"key": self._build_cache_key("imputed", "agg", "5m", "station", station_id), "ttl": 300} # 5 minutes
46+
cache_opts = {"key": self._build_cache_key("imputed", "agg", "5m", "station", station_id), "ttl": 3600} # 1 hour
4747
columns = [
4848
"STATION_ID",
4949
"LANE",

pems_streamlit/src/pems_streamlit/apps/districts/app_stations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def match(m: re.Match):
3434
return S3.get_prefixes(pattern, initial_prefix=STATIONS.imputation_detector_agg_5min, match_func=match)
3535

3636

37-
@st.cache_data(ttl=300) # Cache for 5 minutes
37+
@st.cache_data(ttl=3600) # Cache for 1 hour
3838
def load_station_data(station_id: str) -> pd.DataFrame:
3939
"""
4040
Loads station data for a specific station.

0 commit comments

Comments
 (0)