0

I was wondering if there is any downside to using E-Tag cache for every request and response.

To be more specific, I'm building a data heavy SPA connected to a Laravel API and the client insists that he should be able to see 200 or 300 results at a glance. Although the data is text-only, it is quite a heavy network load of 2 or 3 MB per response. I decided to use E-Tag cache for everything to both ensure that data is always up-to-date and to prevent the internet usage of the app to go over the roof.

Now, I have many resources of different types, and I'm worried that caching everything might not be fine with the browser(I don't know whether browsers have some limit on how much data they will cache for a given website).

By the way to give more context, I expect the user will open the app and keep using it for 4+ hours at a time, so I can live with the cache dying if the page is completely reloaded or the browser is closed, but the performance is fine after 20 or 30 minutes of working with the app.

3
  • 1
    Hard to say. There is a limit to what browsers will cache, but it can vary by browser and machine, and you likely won't know until you reach it. Frankly, I'd be more concerned with rendering speed of the site. 2-3 MB per response is quite large IMO.
    – Dan Wilson
    Nov 3, 2021 at 13:50
  • Is the 2-3 MB payload size before or after compression? Many web servers compress files sent over the network via HTTP. With text files, the compression could be a 5-10x reduction in payload size. Nov 3, 2021 at 16:13
  • It's before compression. The rendering works fine at the moment, I'm mostly concerned with internet speed bottleneck.
    – Ali Rahimi
    Nov 5, 2021 at 9:03

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.