• Hi everybody,

    in my custom page I use wp outside wp core like this

    <?php
    //define('SHORTINIT', true);
    define('WP_USE_THEMES', FALSE);
    require_once('../../wp-load.php');
    global $wpdb;
    if(!current_user_can('commerciali') && !current_user_can('administrator')){
    	wp_redirect('/login/?user_redirect='.$_SERVER['SCRIPT_URI']);
    	die();
    	//wp_die("Non hai accesso alla pagina","ERRORE");
    }
    ?>
    <!DOCTYPE html>
    <html lang="en">
      <head>
        <meta charset="utf-8">
      </head>
      <body>
    		Test
      </body>
    </html>

    Why if I don’t use get_header and WP_USE_THEMES is set to false in source code I’ve this:

    <!DOCTYPE html><html lang="en"><head><link rel="stylesheet" type="text/css" href="https://www.piuchepuoi.it/assets/cache/minify/000000/21108/default.include.b9b46f.css" media="all" /><script type="text/javascript">function w3tc_load_js(u){var d=document,p=d.getElementsByTagName('HEAD')[0],c=d.createElement('script');c.type='text/javascript';c.src=u;p.appendChild(c);}</script><script type="text/javascript">w3tc_load_js('https://www.piuchepuoi.it/assets/cache/minify/000000/21108/default.include.f44574.js');</script><meta charset="utf-8"></head><body> Test<script type="text/javascript">w3tc_load_js('https://www.piuchepuoi.it/assets/cache/minify/000000/21108/default.include-footer.99b7d3.js');</script></body></html>

    Why W3 Total cache load script and style?

    Can you help me? Thanks

    https://www.ads-software.com/plugins/w3-total-cache/

Viewing 1 replies (of 1 total)
  • Ashok

    (@bappidgreat)

    Hello des79

    I think by default it will show cached and minified data. You can flush cache using something like this:

    define('DONOTCACHEPAGE', true);
    define('DONOTCACHEDB', true);
    define('DONOTMINIFY', true);
    define('DONOTCDN', true);
    define('DONOTCACHCEOBJECT', true);
    
    define('DOING_AJAX', true);
    define('WP_USE_THEMES', false);
    
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    header("Cache-Control: no-store, no-cache, must-revalidate");
    header("Cache-Control: post-check=0, pre-check=0", false);
    header("Pragma: no-cache");
    header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
    
    require_once('/../../../wp-load.php');
    w3tc_pgcache_flush();
    
    die();

    Or, how’s about adding the page name in “Never cache the following pages:” in Performance > Page Cache?

    Have a good day!

    Cheers
    Ash

Viewing 1 replies (of 1 total)
  • The topic ‘WP_USE_THEMES false load w3 minify cache’ is closed to new replies.