I have a large array at hand (2300 elements, 280 KB in total, 180 KB in shortest form). I need to handle it either in PHP or JavaScript without loading the page or server too much. There is an autocomplete field in the page and I don’t want it to send request to a 180 KB page every time a user types in a letter (as it seems to be highly inefficient to me). I don’t want to store all that in the original page ‘coz it would slow the page down (wouldn’t it?).
I tried to push it into the Cookies, but it seems that there is no room for such huge array in the Cookies. Any suggestions? Perhaps searching within a database is better solution and I should store them in the database instead?
You want to autocomplete with a list that you load only one ? Store it in a JavaScript file and set the proper cache headers so clients only load the list once.
Do NOT set it as a cookie, that’s just nonsense.