We are making a web frontend for a smart LED strip interface.
The part where I am now is making a functionality where two LED strips in different homes can be linked together (not the same local area network). This is done using one server and multiple clients.
This is done using Apache. The server is basically a REST API where you can POST (for setting) and GET (for obtaining) the hexadecimal color code. All updateable data on the API is no more than 1KB.
How it is currently designed, 5 requests per second per client are made to the server. This is by design.
All works well, and I have zero performance issues.
However, I want the obtaining of the color code to be as swift as possible. My question is:
What is the fastest way to store and obtain such small data in PHP?
I have looked into different solutions, for example databases, storing it raw in a file using file_put_contents and file_get_contents, storing it in environment variables, but I found no documentation on performance.
source https://stackoverflow.com/questions/69727480/fastest-way-to-store-and-obtain-data-in-php
Comments
Post a Comment