Avoid caching a JavaScript file when the page cache is on So I have a custom block that shows a div and a JavaScript (tried inline and file), while page cache is on.
JavaScript loads a uncacheable token got generated through a php function called within block view.
I tried using drupal_add_js to pass parameter to setting and on second drupal_add_js to load file and set cache to false. But setting get cached and provide cached parameter to JavaScript which i dont want.

drupal_add_js('var videoPlayer = Player.create("' . $container_id . '",' . '"' . $embed_code . '", ' . $params . ');',
        array(
          'type' =&gt; 'inline',
          'async' =&gt; TRUE,
          'scope' =&gt; 'footer',
          'cache' =&gt; FALSE
        )
      );
drupal_page_is_cacheable(FALSE);


Is what you're looking for.