Title: dFlip Caching Issues
Last modified: January 23, 2025

---

# dFlip Caching Issues

 *  Resolved [troyw2015](https://wordpress.org/support/users/troyw2015/)
 * (@troyw2015)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/dflip-caching-issues/)
 * Hi,
 * I am using dFlip and have had to enable the Siteground Speed Optimiser, in order
   to resolve several other issues. However, since enabling it, the PDF book no 
   longer loads. Instead I get the message ‘Error: Set a Valid Document Source’.
 * By turning off Combine JavaScript Files in Speed Optimiser, I resolve the issue,
   but alas, all my other woes reappear. So I have tried to exclude the JS files
   and excluded /plugins/dflip/assets/js/dflip.min.js however this does not resolve
   the issue.
 * Having tried everything I know, I wonder if you can point me in the right direction
   to fix this?
 * You’ll find the book in the ‘Take a sneak peek….’ section of the page
 * Thanks
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdflip-caching-issues%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 15 replies - 1 through 15 (of 15 total)

 *  Plugin Support [Daniela Ivanova](https://wordpress.org/support/users/daniellaivanova/)
 * (@daniellaivanova)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/dflip-caching-issues/#post-18260586)
 * Hello [@troyw2015](https://wordpress.org/support/users/troyw2015/),
 * I recommend you to try finding the exact handle that should be excluded in the
   manner explained in the [How to Use SG Optimizer’s Filters (Procedure)](https://wordpress.org/support/topic/how-to-use-sg-optimizers-filters-procedure/)
   forum topic.
 * You can find an article with the full list of custom filters below:
   [https://eu.siteground.com/tutorials/wordpress/speed-optimizer/custom-filters/](https://eu.siteground.com/tutorials/wordpress/speed-optimizer/custom-filters/)
 * The one that should be used for excluding a script from the JavaScript combination
   is:
 *     ```wp-block-code
       add_filter( 'sgo_javascript_combine_exclude', 'js_combine_exclude' );function js_combine_exclude( $exclude_list ) {  $exclude_list[] = 'script-handle';  $exclude_list[] = 'script-handle-2';  return $exclude_list;}
       ```
   
 * As an alternative, you can also post a ticket through your SiteGround Client 
   Area where our Technical support members will gladly take a look at the problem
   and will provide assistance in resolving it.
 * Best Regards,
   Daniela Ivanova
 *  Thread Starter [troyw2015](https://wordpress.org/support/users/troyw2015/)
 * (@troyw2015)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/dflip-caching-issues/#post-18262288)
 * Hi and thanks for your prompt response.
 * I followed your link ‘How to Follow SG Optimizers Filters’ but the code does 
   not generate anything when I select “Inspect Element.” Under “Styles,” and search
   for “handle” or “data-handle.” I get no results?
 * The dFlip developer has suggested that I try to exclude `**df-shortcode-script**`
   but this does not appear in the list of exclusions. How can I add this or how
   can I find this Handle you speak of?
 *  Plugin Support [Simeon Boev](https://wordpress.org/support/users/k3llanved/)
 * (@k3llanved)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/dflip-caching-issues/#post-18262514)
 * Hello [@troyw2015](https://wordpress.org/support/users/troyw2015/),
 * One of the steps provides a bit more information on how to check the handle you
   and its value:
 * `After the affected URL page has been loaded, right-click on the page (any location)
   and select “Inspect Element.” Under “Styles,” enter and search for “handle” or“
   data-handle.” Click [here](http://prntscr.com/st7bj1). You will then see a list
   of all styles and scripts with a “data-handle.” The “data-handles” presented 
   are equivalent to the “style-handle” or “script-handle” noted in SGO’s filters.
   Click [here](https://prnt.sc/slcmnc) for an example of what the results looks
   like.`
 * If you already have the handle there is no need to go through the trouble of 
   searching for it. Use the snippet provided earlier and replace the script-handle
   field with “df-shortcode-script”:
 *     ```wp-block-code
         $exclude_list[] = 'script-handle';
       ```
   
 * Plugins can utilize a wide variety of handles, which means not all of them are
   listed because there could be hundreds of entries.
 * Best Regards,
 * Simeon Boev
 *  Thread Starter [troyw2015](https://wordpress.org/support/users/troyw2015/)
 * (@troyw2015)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/dflip-caching-issues/#post-18262534)
 * Hey Simeon,
 * Yes, I have read the section you pasted above and it does not work.
 * I installed ‘Code Snippet’ Plugin as instructed and added the following to the
   Functions PHP;
 * `add_filter( 'script_loader_tag', 'cameronjonesweb_add_script_handle', 10, 3 );
   
   function cameronjonesweb_add_script_handle( $tag, $handle, $src ) {return str_replace('
   <script', sprintf('<script data-handle="%1$s"',esc_attr( $handle )), $tag );}
 * I can see the code is there, but when I go into the Inspect and Styles, I search
   for Handle and get no results?
 * The code is there now, so please check it in inspector yourself and you’ll see.
 * I am a bit confused about these handles. Am I missing a step? Do I need to name
   something somewhere?
 * Thanks
    -  This reply was modified 1 year, 4 months ago by [troyw2015](https://wordpress.org/support/users/troyw2015/).
 *  Plugin Support [Simeon Boev](https://wordpress.org/support/users/k3llanved/)
 * (@k3llanved)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/dflip-caching-issues/#post-18262556)
 * The code is placed as intended and you just need to use the Inspector tool. Just
   search in the HTML(not Styles) for handle or data-handle and you will find the
   needed information.
 *  Thread Starter [troyw2015](https://wordpress.org/support/users/troyw2015/)
 * (@troyw2015)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/dflip-caching-issues/#post-18262596)
 * OK, so I searched the HTML and found 22 data-handles. I can’t find any clues 
   as to which is the right one, som tried these ones as they are in the area of
   the block. Still it doesn’t work!
 * `add_filter( 'sgo_js_minify_exclude', 'js_minify_exclude' );
   function js_minify_exclude(
   $exclude_list ) {$exclude_list[] = 'dflip-script';$exclude_list[] = 'wp-polyfill';
   $exclude_list[] = 'wp-url';$exclude_list[] = 'wp-api-fetch';
 *     ```wp-block-code
       return $exclude_list;
       ```
   
 * `}`
    -  This reply was modified 1 year, 4 months ago by [troyw2015](https://wordpress.org/support/users/troyw2015/).
 *  Thread Starter [troyw2015](https://wordpress.org/support/users/troyw2015/)
 * (@troyw2015)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/dflip-caching-issues/#post-18262611)
 * Also tried these;
 * `$exclude_list[] = 'wp-i18n';
   $exclude_list[] = 'dflip-script-js';
 * Still doesn’t work?
 *  Plugin Support [Georgi Ganchev](https://wordpress.org/support/users/georgiganchev/)
 * (@georgiganchev)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/dflip-caching-issues/#post-18263487)
 * [@troyw2015](https://wordpress.org/support/users/troyw2015/)
 * You can contact the support of dFlip so they can provide you with the exact handle
   to exclude, presenting them with the filter that my colleague provided should
   be sufficient for them to specify the handle.
 * You can also open a Helpdesk request from the SiteGround Client Area should you
   need any help on our end.
 * Best regards,
   Georgi GanchevSiteGround.com
 *  Thread Starter [troyw2015](https://wordpress.org/support/users/troyw2015/)
 * (@troyw2015)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/dflip-caching-issues/#post-18268820)
 * I have asked the developer for dFlip and this is the resoponse;
 * The shortcode is handled by a function `shortcode` in Class `DFlip_ShortCode`.
   This is in file inc/shortcodde.php
 *     ```wp-block-code
           add_shortcode( 'dflip', array( $this, 'shortcode' ) );
       ```
   
 * Not sure how are going to exclude php functions in cache.
 * For HTML cache, in other cache plugins like wp-rocket, excluding the script class**`
   df-shortcode-script`** works
 *     ```wp-block-code
       <script class="df-shortcode-script" type="application/javascript">window.df_option_5413 = .................
       ```
   
 *  Plugin Support [Georgi Ganchev](https://wordpress.org/support/users/georgiganchev/)
 * (@georgiganchev)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/dflip-caching-issues/#post-18269190)
 * [@troyw2015](https://wordpress.org/support/users/troyw2015/),
 * You can open a Helpdesk request with detailed instructions on how we can replicate
   the issue with the PDF. Our Technical Support team will investigate further for
   you.
 * Alternatively, you may wish to consult with a professional WordPress developer
   to identify the specific handle that needs to be excluded.
 * Best regards,
   Georgi GanchevSiteGround.com
 *  Thread Starter [troyw2015](https://wordpress.org/support/users/troyw2015/)
 * (@troyw2015)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/dflip-caching-issues/#post-18269204)
 * Hey Georgi,
 * As mentioned in my previous message, I have discussed with the actual plugin 
   developer and this is what they have said. I have followed your directions and
   even excluded the `dflip-script` but it isn’t working. As I am a developer, I
   am certainly not paying another one to do exactly what I have been doing.
 * I will go back to Dearhive Plugin developers, but like myself, they appear to
   be at a loss as to why your plugin doesn’t have proper exclusion options. Since
   SiteGround use this particular Caching system, its not ideal that the associated
   plugin is so restrictive.
 * They have also reported this error from your plugin, which may be related? `siteground-
   optimizer…bc13ffa2574afb.js:2 Uncaught Error: No Usercentrics script ID "usercentrics-
   cmp" found`
    -  This reply was modified 1 year, 4 months ago by [troyw2015](https://wordpress.org/support/users/troyw2015/).
 *  Plugin Support [Georgi Ganchev](https://wordpress.org/support/users/georgiganchev/)
 * (@georgiganchev)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/dflip-caching-issues/#post-18269311)
 * [@troyw2015](https://wordpress.org/support/users/troyw2015/)
 * The drop-down list displayed in the plugin contains JS files that have been implemented
   using standard coding procedures. Files that have been added without adhering
   to the recommended coding standards will not appear in the drop-down list.
 * The “usercentrics-cmp” is unlikely to be causing the issue on the page, the error
   in the source indicates that when combined the script is trying to interact with
   the Usercentrics CMP but cannot find the required script or configuration on 
   your site. It is likely you may want to exclude this script from being combined,
   it should be present int he list as /plugins/termageddon-usercentrics/public/
   js/termageddon-usercentrics-ajax.min.js
 * After doing such changes it is important to flush the cache of your application
   and the Speed Optimizer cache for the changes to be reflected.
 * Please open a Helpdesk request and include details of how we can replicate the
   problem and what breaks when the combination is enabled. This will help us further
   assist you by inspecting your website code and applying the filter to exclude
   the problematic handle.
 * Best regards,
   Georgi GanchevSiteGround.com
 *  Thread Starter [troyw2015](https://wordpress.org/support/users/troyw2015/)
 * (@troyw2015)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/dflip-caching-issues/#post-18271007)
 * Hi Georgi,
 * I excluded the /plugins/termageddon-usercentrics/public/js/termageddon-usercentrics-
   ajax.min.js but it did not fix the issue. I have passed this thread on to the
   dFlip developer, who has asked how to exclude inline scripts? Please advise.
 * Thanks
 *  Plugin Support [Simeon Boev](https://wordpress.org/support/users/k3llanved/)
 * (@k3llanved)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/dflip-caching-issues/#post-18271100)
 * Hello,
 * You can exclude** **inline scripts from being combined using the following filter.
   Here’s a code snippet, you can add to your functions.php file to do so:
 *     ```wp-block-code
       add_filter( 'sgo_javascript_combine_excluded_inline_content', 'js_combine_exclude_inline_script' );
       function js_combine_exclude_inline_script( $exclude_list ) {
         $exclude_list[] = 'first few symbols of inline content script';
   
         return $exclude_list;
       }
       ```
   
 * Best Regards,
 * Simeon Boev
 *  Thread Starter [troyw2015](https://wordpress.org/support/users/troyw2015/)
 * (@troyw2015)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/dflip-caching-issues/#post-18271120)
 * Hey Simeon,
 * I added that code to the ‘Code Snippets’ function PHP section and it did not 
   work. I then tried adding it directly to the function.php file and it still did
   not work. Obviously I need the first few symbols of inline content script and
   tried df-shortcode-script without success, so I will pass this on to the dFlip
   developer and get their feedback.
 * Thanks
    -  This reply was modified 1 year, 4 months ago by [troyw2015](https://wordpress.org/support/users/troyw2015/).

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘dFlip Caching Issues’ is closed to new replies.

 * ![](https://ps.w.org/sg-cachepress/assets/icon-256x256.gif?rev=2971889)
 * [Speed Optimizer - The All-In-One Performance-Boosting Plugin](https://wordpress.org/plugins/sg-cachepress/)
 * [Support Threads](https://wordpress.org/support/plugin/sg-cachepress/)
 * [Active Topics](https://wordpress.org/support/plugin/sg-cachepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sg-cachepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sg-cachepress/reviews/)

 * 15 replies
 * 4 participants
 * Last reply from: [troyw2015](https://wordpress.org/support/users/troyw2015/)
 * Last activity: [1 year, 4 months ago](https://wordpress.org/support/topic/dflip-caching-issues/#post-18271120)
 * Status: resolved