eficode-academy / kubernetes-katas

Deliberate exercises for Kubernetes
264 stars 274 forks source link

Frontend cache-control TTL #112

Open klausmark opened 3 months ago

klausmark commented 3 months ago

In some of the labs, you use the NodePort to connect to the frontend. If done through a PROXY the dynamic content is cached. The frontend should set appropriate headers to fix this.

michaelin commented 3 months ago

Thanks @klausmark. Nice catch.

This issue caused problems in the rolling updates exercise. After doing a rolling update, the image version wasn't updated in the UI. When describing the pods, it was correct, though.

It seems like we need to set the cache-control header as suggested. See https://stackoverflow.com/questions/23112316/using-flask-how-do-i-modify-the-cache-control-header-for-all-output

klausmark commented 3 months ago

Hi @michaelin After reviewing the source code of quotes-flask, I’m reconsidering my initial assumption. It seems more likely that the issue could be due to the browser’s JavaScript settings or possibly the proxy interfering with JavaScript execution on non-HTTPS, non-standard port websites.