gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
29.49k stars 2.19k forks source link

Browsers can cache the results of the `/custom_component` route, leading to confusion when new versions are published #8168

Closed freddyaboulton closed 2 weeks ago

freddyaboulton commented 2 weeks ago

Describe the bug

This happened to me while I was developing the leaderboard component last week. I don't have screenshots but what happened was the following:

We should set a Cache-Control: no-cache header so that browsers don't use any cached requests.

Have you searched existing issues? 🔎

Reproduction

-

Screenshot

No response

Logs

No response

System Info

gradio 4.27.0

Severity

I can work around it

pngwn commented 2 weeks ago

I don't think we should set no cache but we could probably set a max age of 5 mins or so?

pngwn commented 2 weeks ago

We could also look into etags to allow more efficient revalidation.

freddyaboulton commented 2 weeks ago

Yea makes sense!