So for my second screen display, I want to grab the customer data and previous purchases from my online database and website. I orginally went through SambaPOS printing out the info in the print template and using scripts to get to the info but this didnt work as there was a noticable lag whilst the info would be downloaded, somtimes causing Samba to go unresponsive. I was at first thinking that I would simply be able to add some AJAX stuff into the print template to retrieve everything from the website once the html has been loaded but I came across the problem of cross domain data calls.
I was wondeirng if anyone here has any experience getting data from a website.
For refence, I will have a url like www.example.com/getorder?id=123456
And at first when the page gets displayed on the second screen it would go loading before turning into the data that url would return
The Browser will probably cache that to avoid downloading every time. If you can look at the Network log in DevTools, you can know for sure.
That said, I generally tend to host library files locally on the webserver, so there is no reliance on 3rd-party sites, and it keeps internet traffic to a minimum because of that. It is just a preference of mine. It is especially useful when the SambaPOS Server is also the Webserver, and if you have no internet connection, you can still host and request pages on your local network. If you were to use a CDN in that case, the GET for the libraries would fail, and in turn, so would the site. Locally hosted does not have this dependency, and it will be much faster than retrieving libraries from the CDN.