I understand your concern about this; unfortunately with the default setup of WordPress, there’s not a way to know whether or not a shortcode appears on the page at the point where scripts and styles are loaded.
Client-side caching helps avoid having to actually transfer the data on each page load. There is a minimal impact from the browser loading these assets, but the scripts are coded so that they don’t do anything unless the elements of the calendar are on the page.
All of that said… there are some ways around this. There hasn’t been much demand for this so I haven’t given it a lot of attention, but I will have a look.
In the meantime, you could write some conditional logic on your own site to dequeue the scripts except on the page you want them to appear on. It would be something like this:
add_action('wp_enqueue_scripts', function() {
if (1 == 2) { // Replace with your conditional logic
global $R34ICS;
wp_dequeue_script(array($R34ICS, 'enqueue_scripts'));
}
}, 99);
(This should work; I haven’t actually tested it.)
Still mulling this issue over. I found a nice blog post that illustrates the exact set of options I had considered, and the associated issues with each:
austingil.com/conditional-scripts-styles-for-wordpress-shortcodes
At this point I still don’t have a definitive solution although I am inclined to experiment with option #1. The problem is, there will definitely be “FOUC” with this approach and ICS Calendar.
For now, suffice to say, you can see why I have so far chosen to “kick the can down the road” on this problem.
(By the way, the code example I gave in my initial reply is, effectively, the same thing as “Option #3” in the blog post.)