Support » Plugin: Jetpack by » BUG? Jetpack Photon won't serve Jetpack Sahring buttons

  • Resolved pazzaglia


    I’ve been putting my website on a resource diet. I need to be wary of any plug-in that is pinging my server too much or using too much bandwidth so Photon is overall a life-saver.

    HOWEVER, one of the biggest resource hogs I haven’t been able to tame is the Jetpack Sharing buttons – the facebook, twitter, pinterest, print, etc. images are loaded one at a time – that’s about 10 hits to the server for every page I load from the sharing buttons alone!

    Though the graphics do not take up much bandwidth each ping to the server (no matter how big) is using up resources.

    I’m surprised that the Jetpack Photon isn’t serving images from Jetpack’s own plug-ins!

    Or.. am I doing something wrong?



    P.S. Example page, if needed:

Viewing 1 replies (of 1 total)
  • Plugin Contributor Jeremy Herve


    Jetpack Mechanic 🚀

    Jetpack Photon only caches and serves images in your post content. It can’t be used as a standard CDN to cache and serve all resources on your site.

    Luckily, the sharing module includes an option to allow you to serve your own CSS and JS instead of Jetpack’s. To do so, please go to Settings > Sharing in your dashboard, and check the “Disable CSS and JS” option.

    Once you’ve checked the option, you will be able to manually enqueue your own sharing js and css files.

    Jetpack uses the WP_SHARING_PLUGIN_URL constant to build the path to load the libraries. You could change that constant by your own when re enqueueing the sharing libraries, like so:

    // If you want to re enqueue Jetpack's JS library, use the WP_SHARING_PLUGIN_URL constant
    function tweakjp_add_sharing_js() {
        wp_enqueue_script( 'sharing-js-fe', WP_SHARING_PLUGIN_URL . 'sharing.js', array( ), 3 );
    add_action( 'wp_enqueue_scripts', 'tweakjp_add_sharing_js' );
    // But for CSS, you will want to use your own stylesheet, calling your own custom icons, using CSS sprites for example
    function tweakjp_add_sharing_css() {
        wp_enqueue_style( 'sharing', YOUR_OWN_WP_SHARING_PLUGIN_URL.'sharing.css', false, JETPACK__VERSION );
    add_action( 'wp_enqueue_scripts', 'tweakjp_add_sharing_css' );
Viewing 1 replies (of 1 total)
  • The topic ‘BUG? Jetpack Photon won't serve Jetpack Sahring buttons’ is closed to new replies.