Reduce Cookie Size

What are Cookies?

Cookies, or as they are formerly called, HTTP cookies, are the small snippets of text, or data, sent by the web server to the user, or client’s browser. The most common uses for cookies are to track and store a user’s session, like shopping carts, logins, etc., remember user preferences, and tracking a user’s behavior across web pages. There are two to three types of HTTP cookies, depending on how you classify them. There are persistent cookies, session cookies, and third-party cookies. While most cookies from trusted sites are safer, third-party cookies can be more of a potential risk to users, used to serve up specific ads, which makes up most of the cookies today. You might see this in the form of a message at the bottom of a new site you visit and be asked to accept or deny their cookie terms.

How to Reduce Cookie Size

Cookies help developers provide a better, more personalized web experience. However, like any element that is part of a web page, keeping file size to a minimum will provide a better experience. While the maximum size for a cookie is just over 4kB, however, browsers like Chrome, Firefox, and Internet Explorer have set limits, both by limiting the number of cookies per domain and total size of cookies. With that in mind, it is best practice to keep them as small as possible because any cookies over that limit will be ignored. Also, setting an appropriate expires date will ensure old cookies are removed in a timely manner, which help with response times.



Lighthouse is an open-source tool that is used to run an audit against your web pages and provides scores and suggestions for improving page performance, accessibility, SEO, and more.


PageSpeed Terms

PageSpeed Insights is a tool created by Google that reports on the performance of a page on both mobile and desktop devices, and provides suggestions on how that page may be improved.



YSlow is an open-source website analysis tool that can be used to identify web page performance issues. Learn more about the YSlow to enhance your web pages and the user experience.