Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a better way to hide & store read only data for a JQuery/JavaScript app than putting it in PHP arrays?

I am making a mostly client side JavaScript / JQuery app that processes data I store on the server. I do not want this data easily scrape-able by bots, so right now I am storing all of the read-only data inside PHP files that the app gets via JSON and parses on the client side. I decided to do this instead of a MySQL database because I will never need to update the data (and I assumed - perhaps incorrectly - that it would be much easier for the web server to spit out JSON than query a database).

I know this isn't 100% secure, but I thought it would be better than keeping the data in an easily readable javascript or json file.

Is there a better way I can store data on my server so it can only be read when the app needs it, or make it harder to scrape?

Cheers,

like image 220
Jeremy Avatar asked Nov 13 '22 13:11

Jeremy


1 Answers

Have it so that they have to log in in order to access the data, then you can pull what you need from the database when you need it using AJAX and PHP.

like image 126
dqhendricks Avatar answered Nov 16 '22 02:11

dqhendricks