I'm currently fetching a dynamic link from sapo with a php curl script, I see some sites are doing this but they cache the link for 15 minutes so the script doesn't have to run every time someone plays a video, does anyone know how to do this? example sites: hentaistream.com and animestigma.com
I should save the time you fetched it in a DB, if the time is greater than 15 minutes, save the time again and run the script.
Oh that's a good idea, can that be done in a php script? The script I have goes to sapo to fetch a link and takes about 1.5 seconds, would that lag if there's a lot of posts?
I don't have any knowledge of sapo i'm sorry, but if it takes 1.5 seconds YES! In pure php its atleast 1/3 of that speed! I'm always using simpleHTMLdom to fetch website's, might want to take a look at it: http://simplehtmldom.sourceforge.net/
oh I got a caching script but I need a quick change in this code: <?php $fp = fopen($cachefile, 'w'); fwrite($fp, ob_get_contents()); fclose($fp); ob_end_flush(); die(); ?> see it writes to a cache file with a url inside but I need it to use the header function to automatically download from the url like this: header("Location: $url here");