dosubot[bot] commented on issue #38219:
URL: https://github.com/apache/superset/issues/38219#issuecomment-3952272116

   <!-- Answer -->
   Interesting issue! Based on my research, the dynamic filter values endpoint 
(`/api/v1/datasource/.../column/.../values/`) [actually doesn't use any 
caching](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/datasource/api.py#L38-L125)β€”it
 queries the database directly on each request via the [`values_for_column()` 
method](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/models/helpers.py#L1326-L1378).
   
   Some clarification on the cache configs:
   - **FILTER_STATE_CACHE_CONFIG** stores the user's *selected filter values* 
(their choices), not the available dropdown options
   - **DATA_CACHE_CONFIG** caches *chart query results*, not filter value 
queries
   
   Since dynamic filter values aren't cached at the Superset level, the stale 
values you're seeing might be caused by:
   1. **Browser-level caching** of the API response
   2. **Database-level caching** (some databases cache query results)
   3. **A reverse proxy or CDN** caching the API calls
   
   Could you verify whether the issue persists if you open the browser dev 
tools, disable cache, and reload the filter dropdown? Also, checking your 
network tab to see if the `/values/` endpoint returns a 304 Not Modified vs a 
fresh 200 response could help narrow this down.
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/ede54643-a246-4839-956c-6b7ab6bfd681?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/ede54643-a246-4839-956c-6b7ab6bfd681?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/ede54643-a246-4839-956c-6b7ab6bfd681?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/ede54643-a246-4839-956c-6b7ab6bfd681?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/ede54643-a246-4839-956c-6b7ab6bfd681?feedback_type=hallucination)
 | [Report 
πŸ›](https://app.dosu.dev/response-feedback/ede54643-a246-4839-956c-6b7ab6bfd681?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/ede54643-a246-4839-956c-6b7ab6bfd681?feedback_type=other)</sup>
   
   [![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=Interesting%20issue%21%20Based%20on%20my%20research%2C%20the%20dynamic%20filter%20values%20endpoint%20%28%60/api/v1/datasource/.../column/.../values/%60%29%20%5Bactually%20doesn%27t%20use%20any%20caching%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/datasource/api.py%23L38-L125%29%E2%80%94it%20queries%20the%20database%20directly%20on%20each%20request%20via%20the%20%5B%60values_for_column%28%29%60%20method%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/models/helpers.py%23L1326-L1378%29.%0A%0ASome%20clarification%20on%20the%20cache%20configs%3A%0A-%20%2A%2AFILTER_STATE_CACHE_CONFIG%2A%2A%20stores%20the%20user%27s%20%2Aselected%20filter%20values%2A%20
 
%28their%20choices%29%2C%20not%20the%20available%20dropdown%20options%0A-%20%2A%2ADATA_CACHE_CONFIG%2A%2A%20caches%20%2Achart%20query%20results%2A%2C%20not%20filter%20value%20queries%0A%0ASince%20dynamic%20filter%20values%20aren%27t%20cached%20at%20the%20Superset%20level%2C%20the%20stale%20values%20you%27re%20seeing%20might%20be%20caused%20by%3A%0A1.%20%2A%2ABrowser-level%20caching%2A%2A%20of%20the%20API%20response%0A2.%20%2A%2ADatabase-level%20caching%2A%2A%20%28some%20databases%20cache%20query%20results%29%0A3.%20%2A%2AA%20reverse%20proxy%20or%20CDN%2A%2A%20caching%20the%20API%20calls%0A%0ACould%20you%20verify%20whether%20the%20issue%20persists%20if%20you%20open%20the%20browser%20dev%20tools%2C%20disable%20cache%2C%20and%20reload%20the%20filter%20dropdown%3F%20Also%2C%20checking%20your%20network%20tab%20to%20see%20if%20the%20%60/values/%60%20endpoint%20returns%20a%20304%20Not%20Modified%20vs%20a%20fresh%20200%20response%20could%20help%20narrow%20this%20down.)&nbsp;[![Join
 Discord]
 
(https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/38219)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to