svsticky / magnificent-sloth

Point of Sale for Dead Mongoose
4 stars 3 forks source link

Cache pictures #51

Closed Riscky closed 3 years ago

Riscky commented 3 years ago

Product pictures are fetched every times Mongoose loads, which is slow and error-prone. Caching pictures locally would solve this. I think pictures have an unique ID / path, so there should not be any gotcha's. This might need to be fixed server-side by setting some headers, but I'm not sure

Riscky commented 3 years ago

See: https://www.cloudsavvyit.com/3782/how-to-configure-cache-control-headers-in-nginx/

Phavion commented 3 years ago

This is fixed in a PR in sadserver. However, pictures are not the only culprit. The complete product page is rendered every time someone puts their card on the reader. One should cache the product page and refresh it once a day/ on startup / one pressing a button etc.

Riscky commented 3 years ago

svsticky/sadserver/pull/332 has been merged, which should fix the picture caching issue. There is already an issue to discuss caching the products (#32)