Is there a way to tell curl to not use cache

前端 未结 5 1944
盖世英雄少女心
盖世英雄少女心 2021-02-01 03:45

I am trying to find out file size of an url:

$url1 = \'www.google.com\';
$curl1 = curl_init();
curl_setopt($curl1, CURLOPT_URL, $url1); 
curl_setopt($curl1, CURL         


        
5条回答
  •  隐瞒了意图╮
    2021-02-01 04:16

    The best way to avoid caching is applying the time or any other random element to the url, like this:
    $url .= '?ts=' . time();

    so for example instead of having
    http://example.com/content.php
    you would have
    http://example.com/content.php?ts=1212434353

提交回复
热议问题