Hello. I have created a PHP script, and in order to prevent excessive hammering of the product API that supplies the shopping content to the script, I need to code in some kind of caching. But, I'm not sure where to begin. I was thinking about creating a cache file for each API request using some kind of output cache, and then keeping that file around for a few days. After about 7 days, the file would be deleted. This sounds good in theory, but I don't know how to do this. It seems that searching google produces results related to caching mySQL results.
What is the best way to code a caching script?
1
Hello. I have created a PHP script, and in order to prevent excessive hammering of the product API that supplies the shopping content to the script, I need to code in some kind of caching. But, I'm not sure where to begin.
I was thinking about creating a cache file for each API request using some kind of output cache, and then keeping that file around for a few days. After about 7 days, the file would be deleted. This sounds good in theory, but I don't know how to do this. It seems that searching google produces results related to caching mySQL results.
I'm not asking to be spoon fed, and I'm sure I can figure this out eventually. I would appreciate being point in the right direction, and I would like to hear solutions about what other people have found. I've been coding for just a few months now, and I'm just too new to really know what's out there and what's "best."
Thanks!
- Nite
I was thinking about creating a cache file for each API request using some kind of output cache, and then keeping that file around for a few days. After about 7 days, the file would be deleted. This sounds good in theory, but I don't know how to do this. It seems that searching google produces results related to caching mySQL results.
I'm not asking to be spoon fed, and I'm sure I can figure this out eventually. I would appreciate being point in the right direction, and I would like to hear solutions about what other people have found. I've been coding for just a few months now, and I'm just too new to really know what's out there and what's "best."
Thanks!
- Nite
- wayfarer
Next Topics on Trending Feed
-
1