I have a site, which requests data from a SQL DB, from different rows, in different tables on each pageview.
I’m planning to just save all the data as temporary cache in cookies (with JSON) on the first pageview, so things work out allot faster (no more querying).
Haven’t completely thought it out yet, but I’m just planning on throwing it all in an array, JSON decoding it, throwing it in a cookie and then pulling it back up when needed.
What concerns me is the possibility of issues that could encounter, when storing large cookies on the client side.
Do you guys think this is a good idea, or a stupid one?
If its stupid, any alternatives?
consider using APC or Memcachced
These are capable of storing large data and are faster to access.
Using Cookies has several drawbacks other than its size limit. On every page request, the cookies are send back to server, thus, increasing your tranfer data/traffic, and request becomes heavier. The reason why a CDN concept came to picture, to prevent cookies transfers.