Skip to content

Commit 794dec7

Browse files
committed
Update cache bypass parameters in user retention pages:
- Modified the `get_market_list` function in `user_retention_explorer_page.py` to use `bypass_cache=true` instead of `use_cache=False` for correct cache middleware handling. - Updated the `load_retention_data` function in `user_retention_summary_page.py` to reflect the same change, ensuring consistent cache bypass behavior across user retention data fetching functions.
1 parent 1b88cf9 commit 794dec7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/page/user_retention_explorer_page.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ def is_processing(result):
1212
@st.cache_data(ttl=3600) # Cache for 1 hour
1313
def get_market_list():
1414
"""Fetches the list of available markets for the dropdown."""
15-
# Add use_cache=False to bypass the backend's cache middleware for this simple, fast endpoint.
16-
return fetch_api_data(section="user-retention-explorer", path="markets", params={"use_cache": False})
15+
# The middleware expects `bypass_cache=true`, not `use_cache=False`.
16+
return fetch_api_data(section="user-retention-explorer", path="markets", params={"bypass_cache": "true"})
1717

1818
# Function to call the calculation endpoint
1919
def calculate_retention(market, start_date):

src/page/user_retention_summary_page.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ def get_error_message(result):
2828
@st.cache_data(ttl=300) # Cache data for 5 minutes
2929
def load_retention_data():
3030
"""Fetches user retention summary data from the backend API, which reads from a static file."""
31-
# Add use_cache=False to bypass the backend's cache middleware for this simple, fast endpoint.
32-
data = fetch_api_data(section="user-retention-summary", path="summary", params={"use_cache": False}, retry=False)
31+
# The middleware expects `bypass_cache=true` to skip caching.
32+
data = fetch_api_data(section="user-retention-summary", path="summary", params={"bypass_cache": "true"}, retry=False)
3333
return data
3434

3535
def user_retention_summary_page():

0 commit comments

Comments
 (0)