Deekshith's avatar

set up the website to not return a cache-control: private header, and return cookies only on the pages it really needs

i am using the laravel application and it has high traffic and i had a conversation with server provider and he suggested two solution for this like below,

To reduce the impact of traffic on the server, I would highly recommend utilizing the server's cache. To do so, you should set up the website to not return a cache-control: private header, and return cookies only on the pages it really needs (like checkout pages, etc.)

Also based on my htaccess code they replied like below,


Based on my findings, the application returns the cache-control header. Please keep in mind that PHP scripts can return custom HTTP headers as well. So in this case the header is not returned by a .htaccess option, but rather the website application (Laravel).```



Where to check this header which is set to private and any suggestions on this?
Thank you.
0 likes
5 replies
Snapey's avatar

And they did not say anything about serving static assets from a cdn? or caching responses? or optimising images? or using compression? or reducing the font stack? or using vapor, or Octane?

Ive never heard of anyone making a site quicker by only sending cookies on specific pages.

1 like
Deekshith's avatar

@snapey Thanks for the reply, Yes they also replied like below,

Having said that, the traffic appears to be legitimate. So there is nothing we could do in that regard like blocking bad bots, etc.

However, I noticed that websiteaddress.com is not using the server's caching:
cache-control: private, must-revalidate

To make it public i should create a separate custom middleware right?

Snapey's avatar

focus on making your responses quicker

1 like
martinbean's avatar

@deekshith Your server provider sound like they don’t actually have a clue about caching, as sending Cache-Control: private, must-revalidate is going to defeat the point of caching entirely. Not sending cookies isn’t going to reduce load on the server, and saying the website should only be cached in private caches means you can’t make use of things like edge caches where pages could be cached when requested by user A, and the cached version returned to user B when they request the same page.

1 like

Please or to participate in this conversation.