title: How to develop site which dynamically changes og:image facebook property?
body: <p>Basically, I am making a website which has dynamic og:image property. I have added 100 images and changing the images by rand function in PHP.
  The problem I am getting is that Facebook have cached my website and everytime user shares the URL, it shows the same image every time. I want Facebook to recrawl everytime the link is posted and shows random images.</p>
  
  <p>Here is the code of the page I have developed:</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=windows-1252"&gt;
          &lt;meta name="viewport" content="initial-scale=1, maximum-scale=1"&gt;
          &lt;meta name="twitter:card" value="summary"&gt; 
  
          &lt;meta property="fb:app_id" content="xxxxxxxxxxxxx10" /&gt;
          &lt;meta property="og:description" content="Like it? Share with friends... "/&gt;
          &lt;meta property="og:title" content="Your future company is" /&gt;
          &lt;meta property="og:type" content="article" /&gt;
          &lt;meta property="og:url" content="http://justtodo.xyz/company/" /&gt;
          &lt;?php 
              $imageURL = 'http://justtodo.xyz/company/images/' . rand(1, 100) . '_260x135.jpg';
          ?&gt;
          &lt;meta property="og:image" content="&lt;?php echo($imageURL)?&gt;"  /&gt;
          &lt;meta property="og:image:type" content="image/jpeg" /&gt;
          &lt;meta property="og:image:width" content="200" /&gt;
          &lt;meta property="og:image:height" content="200" /&gt;
  
  
      &lt;script&gt;
        (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
        (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
        m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
        })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  
        ga('create', 'UA-100487432-1', 'auto');
        ga('send', 'pageview');
  
      &lt;/script&gt;
  
      &lt;script  src="https://code.jquery.com/jquery-1.7.1.min.js"  integrity="sha256-iBcUE/x23aI6syuqF7EeT/+JFBxjPs5zeFJEXxumwb0="  crossorigin="anonymous"&gt;&lt;/script&gt;
  
      &lt;script&gt;
  
  
  
  
      window.fbAsyncInit = function() {
          FB.init({
            appId            : 'xxxxxxxxxxxxx10',
            autoLogAppEvents : true,
            xfbml            : true,
            version          : 'v2.9'
          });
          FB.AppEvents.logPageView();
        };
  
        (function(d, s, id){
           var js, fjs = d.getElementsByTagName(s)[0];
           if (d.getElementById(id)) {return;}
           js = d.createElement(s); js.id = id;
           js.src = "//connect.facebook.net/en_US/sdk.js";
           fjs.parentNode.insertBefore(js, fjs);
         }(document, 'script', 'facebook-jssdk'));
  
          FB.api('https://graph.facebook.com/', 'post', {
              id: '&lt;?php echo($imageURL)?&gt;',
              scrape: true
          }, function(response) {
              //console.log('rescrape!',response);
          });
      &lt;/script&gt;
  
      &lt;title&gt;Your future company...&lt;/title&gt;
  
  
      &lt;META HTTP-EQUIV="REFRESH" CONTENT="0; URL=https://youtu.be/uqJNjb-zg3s"&gt;
      &lt;script&gt;
      setTimeout(function () {    
      window.location.href = "https://youtu.be/uqJNjb-zg3s"; 
      },10);
      &lt;/script&gt;
  
  
  
      &lt;/head&gt;
  &lt;body&gt;
  
  
      &lt;div style="text-align: center;font-size:2em;font-family:Consolas, Andale Mono, Lucida Console,Lucida Sans Typewriter, Monaco, Courier New, monospace"&gt;Loading your company...&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>