In fact it’s completely unfeasible to do that.
128,000 indices in an array, is a large amount to be manipulated and/or compared.
The ideal is to keep such information in the database and search it based on a minimum limit of parameters.
But I have maybe two solutions:
Physical file
This array be kept as a physical file (which extension you want, in json format)
[EDITED] Idea
Just as a complement, in your case, I think it’s best to create a file for each "letter" of the alphabet.
Unless you compare, include values between the array value, for example: Ada
- Ada
- adá
- guava
- giraffe (joke, haha)
With this I believe that the search, is faster (in a single file), but of course, it will increase the number of requests on the server, and to help in this case, leave any file information inline (), so that the size is reduced/compressed to the maximum.
Cached page (json/xml)
I don’t like and/or recommend xml, but feel free
Have a page (route) of your system/site, which contains this array also in json format, however, such page will be cached for the time determined by you.
That way, when other applications go to the specific page (for example: http://www.examplo.com.br/ptbr.json
or http://www.examplo.com.br/ptbr.php
- the extension itself does not matter, but rather how you will handle the request), you return that page, which in this case will be cached, and will not be loaded again.
Doubt
Do you use any framework? The vast majority of them already have a cache system ready, and an excellent administration of the extension/response/protocol type of their request/route.
Some links to help you
I hope I’ve helped.
I was curious as to why I voted against this question. Could the person responsible explain?
– bfavaretto
I share the curiosity of @bfavaretto, a vote against a question should always be commented. Who votes against it is because they saw something wrong with the question and in that case the comment would help to make the necessary improvements.
– Zuul