chesterBot's avatar

what should i cache in e-commerce application

I have a e-commerce Laravel web application where I want to use varnish, I have setup varnish in homestead and everything is working fine, I have never used cache in websites so I m some kind of in doubt that should I cache every route? the first thing which pops up in my mind "no" because there are checkout, confirm page, I was thinking to cache all GET routes and leave POST, is it good? Can someone help me regarding I will appreciate, Thank you

0 likes
2 replies
tykus's avatar

Anything that is not user-specific could be a candidate for caching; so categories, products, CMS pages would immediately come to mind. The cart and checkout flow would be excluded from this since this will be specific to individual sessions.

1 like
martinbean's avatar

@chesterbot Have you actually doing any measuring of your app to see if you need Varnish…?

In response to your question:

what should i cache in e-commerce application

You should cache things that are frequently-accessed and creating a bottleneck in your application. Just chucking things like Varnish on top of your application won’t magically make it “better” or faster or more performant. In fact, adding caching for the sake of caching can cause more problems than it solves.

1 like

Please or to participate in this conversation.