Jump to content

PHP: Caching issue


phpfan101

Recommended Posts

What I have, is a php page that runs over 60 query's a visit, and has over 2000 visits a day. That thousands of query's, and I'm sure this can be simplified easily to lessen the load. I only need to update the data on the page every 12 hours.

 

So, what I'm thinking, is that it would be best to run the query based on time()(every 12 hours), and store that data in a .txt file. Then, the php file, instead of requesting the query over and over, it just extracts the data from the text file. Does this help me at all, or is it useless? is there a better method? Thanks!  :)

Link to comment
https://forums.phpfreaks.com/topic/219138-php-caching-issue/
Share on other sites

Storing it in a text file may be faster than storing it in the db, depending on the data and how you query it.  A more heavy duty solution is memcache, but that would be more suitable for higher levels of traffic.  There's nothing wrong with the concept of storing the data in a text file.

Link to comment
https://forums.phpfreaks.com/topic/219138-php-caching-issue/#findComment-1136394
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.