I'm experimenting with dynamic(ish) server less sites, (no database, serversided languages, etc.) which is why I am hoping to only use JavaScript/AJAX/jQuery. I want to be able to serve a dynamic(ish) webpage with static files.
One solution I came up with is to essentially use text files (json, xml) on the same server as the web page to serve as a datastore. But I could only find ways to load the entire file rather than specific parts of it. Which isn't really a big problem since the text files are small, however the text files could potentially grow to be large.
If you could load the file line by line, the payload to the client would be faster, and the JavaScript parsing would be sped up significantly.
If I am only interested in fresh data, I was hoping I could prepend the data to the top of the file when populating the file and read it in line by line (since I would only be interested in say 10 lines per page). Also access to the middle of a file would be incredibly useful.
I just want to avoid having to send the entire file to a client(not for security but for space/time efficiency).
Is there any way to do this in JavaScript? Or am I missing an obvious solution?