Jump to content

Good Caching Method


upgrader

Recommended Posts

Hi there, I've never really done any caching at all so I'm looking for suggestions for caching the results of this script so that instead of it running everytime the page loads it only say once every hour.

 

   
                                      $html = file_get_contents('http://badhausen.hlstatsx.com/?mode=players&game=css');
   
                                      $dom = new domDocument;
   
                                      $dom->loadHTML($html);
   
                                      $dom->preserveWhiteSpace = false;
   
                                     
   
                                      $x = new DomXPath($dom);                                     
   
                                      $results = $x->query('//table/tr[position() >= 2 and position() <= 4]/td[2]/font/a');
                                     
  
                                      foreach ($results as $result) {  
                                              echo "<li>".$result->nodeValue."</li>\n";  
                                              }

Link to comment
https://forums.phpfreaks.com/topic/160352-good-caching-method/
Share on other sites

  Quote

  Quote

Try do Google with "caching with php".

 

 

Thanks for your input... notice how I was asking for a good caching method in this situation...

 

@dreamwest: what does that do etc? Could you explain it?

 

It caches everything with the filesmatch extension. max-age is in seconds

Link to comment
https://forums.phpfreaks.com/topic/160352-good-caching-method/#findComment-846226
Share on other sites

  Quote

  Quote

Try do Google with "caching with php".

 

 

Thanks for your input... notice how I was asking for a good caching method in this situation...

 

@dreamwest: what does that do etc? Could you explain it?

 

Will Cache_lite help you? A good article is at:

www.devshed.com/c/a/PHP/Caching-With-PHP-Cache-Lite

 

Link to comment
https://forums.phpfreaks.com/topic/160352-good-caching-method/#findComment-846358
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.