Skip to main content

Yslow Cookie Free Domain - Wordpress

CLOUDFLARE FULL SSL brakes subdomain  error 526 - invalid certificate.
FIX: change to flexySSL
##################################################

https://support.stackpath.com/hc/en-us/articles/360001152903-How-To-use-the-StackPath-Edge-Address

##################################################

https://www.keycdn.com/support/how-to-use-cookie-free-domains

How To Use Cookie-Free Domains WordPress

If you set your cookies on a top-level domain (e.g. yourwebsite.com) all of your subdomains (e.g. static.yourwebsite.com) will also include the cookies that are set. Therefore, in this case, it is required that you use a separate domain name to deliver your static content if you want to use cookie-free domains. However, if you set your cookies on a www subdomain such as www.yourwebsite.com, you can create another subdomain (e.g. static.yourwebsite.com) to host all of your static files which will no longer result in any cookies being sent.
The following steps outline how to use cookie-free domains in WordPress:
  1. Create a subdomain such as static.yourwebsite.com which is where you will deliver all your static files from.
  2. Point your new subdomain to the /wp-content directory of your WordPress installation. For cPanel users, you will need to update the document root field from public_html/static to public_html/wp-content like the screenshot below.


  3. Edit your wp-config.php file to reflect the following:
    define("WP_CONTENT_URL", "http://static.yourwebsite.com");
    define("COOKIE_DOMAIN", "www.yourwebsite.com");
  4. Run the following command in your SQL database, this will ensure all post URLs are directed to the new subdomain:
    UPDATE wp_posts SET post_content = REPLACE(post_content,'www.yourwebsite.com/wp-content/','static.yourwebsite.com/')
Now that your cookie domain and static content subdomain are set, you can begin delivering static content without the server setting an unnecessary cookie for static assets.

##################################################




More Info:

https://stackoverflow.com/questions/26186358/how-to-use-cookie-free-domains-yslow

##################################################




Comments

Popular posts from this blog

How to fix WordPress 500 Internal Server Errorr after install or upload

When you move a WordPress instalation from one server to another, after you have all files in place, the database, and the database meta updates for the server address you must clear the PERMALINKS . Go to Permalinks -> select some option -> re select old options -> Click save . All pages should be working now . If you still have problems, check folder permissions or user server permissions with the apache service .

Remove Woocommerce Styles & Scripts on other pages

Remove WooCommerce styles and scripts. https://gist.github.com/gregrickaby/2846416   remove-woocommerce-styles-scripts.php <?php //* Do NOT include the opening php tag shown above. Copy the code shown below into functions.php /** * Manage WooCommerce styles and scripts. */ function grd_woocommerce_script_cleaner () { // Remove the generator tag remove_action ( 'wp_head' , array ( $ GLOBALS [ 'woocommerce' ], 'generator' ) ); // Unless we're in the store, remove all the cruft! if ( ! is_woocommerce () && ! is_cart () && ! is_checkout () ) { wp_dequeue_style ( 'woocommerce_frontend_styles' ); wp_dequeue_style ( 'woocommerce-general' ); wp_dequeue_style ( 'woocommerce-layout' ); wp_dequeue_style ( 'woocommerce-smallscreen' ); wp_dequeue_style ( 'woocommerce_fancybox_styles' ); wp_dequeue_style ( 'woocommerce_chosen_styles' ); wp_dequeue...