For the simplicity of the question, I will pretend my site works like this: I have an array of data in Javascript which is used on nearly every page of my site. I use PHP to print this javascript array, on every page. Now this array has grown to about 0.5MB, so It is now lagging the system as you can imagine. The easy option would be to put something in the cache, so the array doesn't need to be printed every time, however, the array that stores the values is updated from time to time, while the user is browsing different pages.
My initial thought was to use javascript cookies to store the information, and maybe just do a quick PHP to check if the array has changed, and If it has delete the old cookie and download the updated array into that cookie. However I am led to believe that cookies have a size limit.
Anyone have any suggestions as to a good approach to this?
Thanks for the help!