I use W3TC cache - can you help me confirure it ?

W3TC cache have primium acc with $100 to support configure W3TC .

But with my membership in Wpmu - can you guide me do that ?

  • Jack Kitterhing

    Hi there @jaavu

    I hope you are well today and thanks for your question.

    While I can't configure it for you.

    I can certainly guide and assist you in doing it :slight_smile:

    First, I'll some more details, what type of site (e-commerce, normal blog etc), Single site or Multisite? Anything that you know can't be cached?

    How often is it updated (the site?)

    Thank you!

    Kind Regards
    Jack.

  • jaavu

    Thanks Jack,
    My site is charmspa.vn .

    At the current i use cache plugin http://wp-rocket.me/ - but i think i have some problem with that plugin , my site still load too slowly on iphone and ipad , and it conflict with some other pluin . So i want to try test W3TC cache .

    + My site is normal blog
    +Single site
    +my site update post daily .
    + Chat plugin i don't want to cache .

    Please guide me . thanks .

  • Imperative Ideas

    It's amazing to me that people pay for W3TC when WP caching plugins are responsible for more white screens of death than anything else, and it's not really even close.

    Your chat plugin should contain "don not cache" headers, I doubt you need to worry about it. If you do, then consider running something like Arrowchat instead.

    Run your DNS over Cloudflare and if you aren't using a child theme where you can combine your own scripts, run a copy of the JS & CSS Script Optimizer (may break poorly written scripts but no more than W3TC's optimizer does and with better fallback options). Cloudflare will include Caching and CDN. From there, all you need to do is add your own browser-side caching in .htaccess and you're gold.

    This usually goes over well as an addition to any root-level htaccess setup:

    # BEGIN block author scans
    <IfModule mod_rewrite.c>
    	RewriteEngine On
    	RewriteBase /
    	RewriteCond %{QUERY_STRING} (author=\d+) [NC]
    	RewriteRule .* - [F]
    </IfModule>
    # END block author scans
    
    #### BEGIN PAGE OPTIMIZATION SCRIPTS ###
    
    <ifModule mod_gzip.c>
    	mod_gzip_on Yes
    	mod_gzip_dechunk Yes
    	mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
    	mod_gzip_item_include handler ^cgi-script$
    	mod_gzip_item_include mime ^text/.*
    	mod_gzip_item_include mime ^application/x-javascript.*
    	mod_gzip_item_exclude mime ^image/.*
    	mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
    </ifModule>
    
    <IfModule mod_deflate.c>
    	AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
    </IfModule>
    
    # turn on the module for this directory
    	ExpiresActive on
    
    # Set default expiration for site
    	ExpiresDefault "access plus 1 months"
    
    # Set expiration for common graphical assets
    	ExpiresByType image/jpg "access plus 1 months"
    	ExpiresByType image/gif "access plus 1 months"
    	ExpiresByType image/jpeg "access plus 1 months"
    	ExpiresByType image/png "access plus 1 months"
    
    # Set expiration for all applicatble script types
    	ExpiresByType text/javascript "access plus 2 weeks"
    	ExpiresByType application/javascript "access plus 2 weeks"
    	ExpiresByType text/js "access plus 2 weeks"
    	ExpiresByType application/js "access plus 2 weeks"
    	ExpiresByType text/php "access plus 2 weeks"
    	ExpiresByType text/css "access plus 2 weeks"
    	ExpiresByType application/x-shockwave-flash "access plus 2 weeks"
    
    # Add a far future Expires header for fonts
    	ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
    	ExpiresByType font/ttf "access plus 1 year"
    	ExpiresByType font/otf "access plus 1 year"
    	ExpiresByType application/x-woff "access plus 1 year"
    	ExpiresByType image/svg+xml "access plus 1 year"
    
    # Add correct content-type for fonts
    	AddType application/vnd.ms-fontobject .eot
    	AddType font/ttf .ttf
    	AddType font/otf .otf
    	AddType application/x-font-woff  .woff
    	AddType image/svg+xml .svg
    
    # Add correct content-type for all other objects
    <IfModule mod_mime.c>
        AddType text/css .css
        AddType application/x-javascript .js
        AddType text/html .html .htm
        AddType text/richtext .rtf .rtx
        AddType image/svg+xml .svg .svgz
        AddType text/plain .txt
        AddType text/xsd .xsd
        AddType text/xsl .xsl
        AddType text/xml .xml
        AddType video/asf .asf .asx .wax .wmv .wmx
        AddType video/avi .avi
        AddType image/bmp .bmp
        AddType application/java .class
        AddType video/divx .divx
        AddType application/msword .doc .docx
        AddType application/x-msdownload .exe
        AddType image/gif .gif
        AddType application/x-gzip .gz .gzip
        AddType image/x-icon .ico
        AddType image/jpeg .jpg .jpeg .jpe
        AddType application/vnd.ms-access .mdb
        AddType audio/midi .mid .midi
        AddType video/quicktime .mov .qt
        AddType audio/mpeg .mp3 .m4a
        AddType video/mp4 .mp4 .m4v
        AddType video/mpeg .mpeg .mpg .mpe
        AddType application/vnd.ms-project .mpp
        AddType application/vnd.oasis.opendocument.database .odb
        AddType application/vnd.oasis.opendocument.chart .odc
        AddType application/vnd.oasis.opendocument.formula .odf
        AddType application/vnd.oasis.opendocument.graphics .odg
        AddType application/vnd.oasis.opendocument.presentation .odp
        AddType application/vnd.oasis.opendocument.spreadsheet .ods
        AddType application/vnd.oasis.opendocument.text .odt
        AddType audio/ogg .ogg
        AddType application/pdf .pdf
        AddType image/png .png
        AddType application/vnd.ms-powerpoint .pot .pps .ppt .pptx
        AddType audio/x-realaudio .ra .ram
        AddType application/x-shockwave-flash .swf
        AddType application/x-tar .tar
        AddType image/tiff .tif .tiff
        AddType audio/wav .wav
        AddType audio/wma .wma
        AddType application/vnd.ms-write .wri
        AddType application/vnd.ms-excel .xla .xls .xlsx .xlt .xlw
        AddType application/zip .zip
    </ifModule>
  • Imperative Ideas

    It's worth mentioning a few things regarding your site as well.

    1. Have a very good reason for a 3.4mb load, especially on a Vietnamese server (a long ways from most tourists connections).
    2. You really do need to combine scripts, you're dumping a ton of them
    3. You load 107 assets on the front page. You should be targeting closer to 35-45 or 70 if you are dealing with an e-commerce front page.
    4. You desperately need to declare thumbnail sizes and use them. See the linked image. That is a 630 x 939 pixel image being displayed at 87 x 120. You have FIVE of those happening. Far better to have the script call an actual thumbnail sized image instead of loading massive graphics as thumbnails.
    5. In addition to all that, you load an SWF file called watch_as3.swf that is a quarter of a meg in size. Does it need to be embedded or can you link to it?

    Good web design is partly art but it's a lot of making compromises in order to deliver the optimal experience. That's something you really need to focus in on. Right now, between the slow server and the poorly optimized assets, your site is physically difficult to load, despite the fact that the website testing sites grade you out at a B. I don't care what the machines say, 16 seconds on broadband is way, way, way too long to wait.

  • jaavu

    Hi Imperative Ideas ,

    Please guide me again some more detail :

    1, you said that :

    The htaccess code is completely unrelated to W3TC, it handles a different side of the process (browser caching)

    You mean, when i install and active cache plugin eg Wp cache or W3TC or WP-rocket plugin , they will auto add more their htacces code into my .htaccess file .
    Together with Cache plugin htaccess code auto add in .htaccess file .I can manual add more you htaccess code below into .htaccess file .

    # BEGIN block author scans
    <IfModule mod_rewrite.c>
    	RewriteEngine On
    	RewriteBase /
    	RewriteCond %{QUERY_STRING} (author=\d+) [NC]
    	RewriteRule .* - [F]
    </IfModule>
    # END block author scans
    
    #### BEGIN PAGE OPTIMIZATION SCRIPTS ###
    
    <ifModule mod_gzip.c>
    	mod_gzip_on Yes
    	mod_gzip_dechunk Yes
    	mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
    	mod_gzip_item_include handler ^cgi-script$
    	mod_gzip_item_include mime ^text/.*
    	mod_gzip_item_include mime ^application/x-javascript.*
    	mod_gzip_item_exclude mime ^image/.*
    	mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
    </ifModule>
    
    <IfModule mod_deflate.c>
    	AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
    </IfModule>
    
    # turn on the module for this directory
    	ExpiresActive on
    
    # Set default expiration for site
    	ExpiresDefault "access plus 1 months"
    
    # Set expiration for common graphical assets
    	ExpiresByType image/jpg "access plus 1 months"
    	ExpiresByType image/gif "access plus 1 months"
    	ExpiresByType image/jpeg "access plus 1 months"
    	ExpiresByType image/png "access plus 1 months"
    
    # Set expiration for all applicatble script types
    	ExpiresByType text/javascript "access plus 2 weeks"
    	ExpiresByType application/javascript "access plus 2 weeks"
    	ExpiresByType text/js "access plus 2 weeks"
    	ExpiresByType application/js "access plus 2 weeks"
    	ExpiresByType text/php "access plus 2 weeks"
    	ExpiresByType text/css "access plus 2 weeks"
    	ExpiresByType application/x-shockwave-flash "access plus 2 weeks"
    
    # Add a far future Expires header for fonts
    	ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
    	ExpiresByType font/ttf "access plus 1 year"
    	ExpiresByType font/otf "access plus 1 year"
    	ExpiresByType application/x-woff "access plus 1 year"
    	ExpiresByType image/svg+xml "access plus 1 year"
    
    # Add correct content-type for fonts
    	AddType application/vnd.ms-fontobject .eot
    	AddType font/ttf .ttf
    	AddType font/otf .otf
    	AddType application/x-font-woff  .woff
    	AddType image/svg+xml .svg
    
    # Add correct content-type for all other objects
    <IfModule mod_mime.c>
        AddType text/css .css
        AddType application/x-javascript .js
        AddType text/html .html .htm
        AddType text/richtext .rtf .rtx
        AddType image/svg+xml .svg .svgz
        AddType text/plain .txt
        AddType text/xsd .xsd
        AddType text/xsl .xsl
        AddType text/xml .xml
        AddType video/asf .asf .asx .wax .wmv .wmx
        AddType video/avi .avi
        AddType image/bmp .bmp
        AddType application/java .class
        AddType video/divx .divx
        AddType application/msword .doc .docx
        AddType application/x-msdownload .exe
        AddType image/gif .gif
        AddType application/x-gzip .gz .gzip
        AddType image/x-icon .ico
        AddType image/jpeg .jpg .jpeg .jpe
        AddType application/vnd.ms-access .mdb
        AddType audio/midi .mid .midi
        AddType video/quicktime .mov .qt
        AddType audio/mpeg .mp3 .m4a
        AddType video/mp4 .mp4 .m4v
        AddType video/mpeg .mpeg .mpg .mpe
        AddType application/vnd.ms-project .mpp
        AddType application/vnd.oasis.opendocument.database .odb
        AddType application/vnd.oasis.opendocument.chart .odc
        AddType application/vnd.oasis.opendocument.formula .odf
        AddType application/vnd.oasis.opendocument.graphics .odg
        AddType application/vnd.oasis.opendocument.presentation .odp
        AddType application/vnd.oasis.opendocument.spreadsheet .ods
        AddType application/vnd.oasis.opendocument.text .odt
        AddType audio/ogg .ogg
        AddType application/pdf .pdf
        AddType image/png .png
        AddType application/vnd.ms-powerpoint .pot .pps .ppt .pptx
        AddType audio/x-realaudio .ra .ram
        AddType application/x-shockwave-flash .swf
        AddType application/x-tar .tar
        AddType image/tiff .tif .tiff
        AddType audio/wav .wav
        AddType audio/wma .wma
        AddType application/vnd.ms-write .wri
        AddType application/vnd.ms-excel .xla .xls .xlsx .xlt .xlw
        AddType application/zip .zip
    </ifModule>

    After add htaccess code into .htaccess file, which cache plugin should i chose?

    This is htaccess code of wp-rocket plugin ( cache plugin ) auto add into my .htaccess file :

    # BEGIN WP Rocket v1.3.7
    # Use UTF-8 encoding for anything served text/plain or text/html
    AddDefaultCharset UTF-8
    # Force UTF-8 for a number of file formats
    <IfModule mod_mime.c>
    AddCharset UTF-8 .atom .css .js .json .rss .vtt .xml
    </IfModule>
    
    # FileETag None is not enough for every server.
    <IfModule mod_headers.c>
    Header unset ETag
    </IfModule>
    
    # Since we're sending far-future expires, we don't need ETags for
    # static content.
    # developer.yahoo.com/performance/rules.html#etags
    FileETag None
    
    <IfModule mod_alias.c>
    <FilesMatch "\.(html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml)$">
    <IfModule mod_headers.c>
    Header set X-Powered-By "WP Rocket/1.3.7"
    Header unset Pragma
    Header append Cache-Control "public"
    Header unset Last-Modified
    </IfModule>
    </FilesMatch>
    
    <FilesMatch "\.(css|htc|js|asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|json|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|ttf|ttc|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip)$">
    <IfModule mod_headers.c>
    Header unset Pragma
    Header append Cache-Control "public"
    </IfModule>
    </FilesMatch>
    </IfModule>
    
    # Expires headers (for better cache control)
    <IfModule mod_expires.c>
    ExpiresActive on
    
    # Perhaps better to whitelist expires rules? Perhaps.
    ExpiresDefault                          "access plus 1 month"
    
    # cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5)
    ExpiresByType text/cache-manifest       "access plus 0 seconds"
    
    # Your document html
    ExpiresByType text/html                 "access plus 0 seconds"
    
    # Data
    ExpiresByType text/xml                  "access plus 0 seconds"
    ExpiresByType application/xml           "access plus 0 seconds"
    ExpiresByType application/json          "access plus 0 seconds"
    
    # Feed
    ExpiresByType application/rss+xml       "access plus 1 hour"
    ExpiresByType application/atom+xml      "access plus 1 hour"
    
    # Favicon (cannot be renamed)
    ExpiresByType image/x-icon              "access plus 1 week"
    
    # Media: images, video, audio
    ExpiresByType image/gif                 "access plus 1 month"
    ExpiresByType image/png                 "access plus 1 month"
    ExpiresByType image/jpeg                "access plus 1 month"
    ExpiresByType video/ogg                 "access plus 1 month"
    ExpiresByType audio/ogg                 "access plus 1 month"
    ExpiresByType video/mp4                 "access plus 1 month"
    ExpiresByType video/webm                "access plus 1 month"
    
    # HTC files  (css3pie)
    ExpiresByType text/x-component          "access plus 1 month"
    
    # Webfonts
    ExpiresByType application/x-font-ttf    "access plus 1 month"
    ExpiresByType font/opentype             "access plus 1 month"
    ExpiresByType application/x-font-woff   "access plus 1 month"
    ExpiresByType image/svg+xml             "access plus 1 month"
    ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
    
    # CSS and JavaScript
    ExpiresByType text/css                  "access plus 1 year"
    ExpiresByType application/javascript    "access plus 1 year"
    
    </IfModule>
    
    # Gzip compression
    <IfModule mod_deflate.c>
    # Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
    <IfModule mod_setenvif.c>
    <IfModule mod_headers.c>
    SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
    RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
    </IfModule>
    </IfModule>
    
    # Compress all output labeled with one of the following MIME-types
    <IfModule mod_filter.c>
    AddOutputFilterByType DEFLATE application/atom+xml \
    		                          application/javascript \
    		                          application/json \
    		                          application/rss+xml \
    		                          application/vnd.ms-fontobject \
    		                          application/x-font-ttf \
    		                          application/xhtml+xml \
    		                          application/xml \
    		                          font/opentype \
    		                          image/svg+xml \
    		                          image/x-icon \
    		                          text/css \
    		                          text/html \
    		                          text/plain \
    		                          text/x-component \
    		                          text/xml
    </IfModule>
    <IfModule mod_headers.c>
    Header append Vary User-Agent env=!dont-vary
    </IfModule>
    </IfModule>
    
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_METHOD} GET
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !(wordpress_logged_in_|wp-postpass_|wptouch_switch_toggle|comment_author_|comment_author_email_) [NC]
    RewriteCond %{REQUEST_URI} !^(.*/feed/)$ [NC]
    RewriteCond %{HTTPS} off
    RewriteCond "%{DOCUMENT_ROOT}/wp-content/wp-rocket-cache/%{HTTP_HOST}%{REQUEST_URI}/index.html" -f
    RewriteRule .* "wp-content/wp-rocket-cache/%{HTTP_HOST}%{REQUEST_URI}/index.html" [L]
    </IfModule>
    # END WP Rocket

    i thinks those htaccess code above take affect browser cache as you said :

    Your server actually seems to leverage the browser cache pretty well already (scores a B in YSlow).

    I don't know about htaccess code , with WP rocket htaccess code above , is it good ? If i don't use WP rocket any more , which code can i continue use in my .htaccess file ?

    2, You said that :

    You really do need to combine scripts, you're dumping a ton of them

    Which method is better in your guide :

    run a copy of the JS & CSS Script Optimizer (may break poorly written scripts but no more than W3TC's optimizer does and with better fallback options)

    3,you said that :

    3. You load 107 assets on the front page. You should be targeting closer to 35-45 or 70 if you are dealing with an e-commerce front page.

    How can i do that ?

    5,

    5. In addition to all that, you load an SWF file called watch_as3.swf that is a quarter of a meg in size. Does it need to be embedded or can you link to it?

    Sorry, i'm only wordpress user , only know implement follow guide , install plugin , custome CSS . i don't know about watch_as3.swf and does it need..?

    If you can, please guide me .

    your site is physically difficult to load .That's something you really need to focus in on

    If you can, please show me some problem with that , i will contact with my theme supplier for that .

    Please guide me . thanks .

  • Jack Kitterhing

    Hi there @jaavu

    I hope you are well today.

    Here, I'd honestly recommend cloudflare over a caching plugin https://www.cloudflare.com/

    It'll honestly speed up your site a lot more once configured than your standard caching plugin :slight_smile:

    Personally I'd recommend the pro plan, but give the free one a go and see how much quicker it is :slight_smile:

    Thank you!

    Kind Regards
    Jack

  • Imperative Ideas

    Jack is right.

    You are asking me to spend the next 45min writing a guide, specifically for you. Cloudflare, however, does CDN, caching, and script compression all through a very fast nginx server setup. You really don't have to do a thing, except remember to put the site in "dev mode" when you are making changes and clear the cache after you reactivate.

    As for htaccess, I'm pretty sure you are good. The stuff I gave you won't hurt anything by being there but it will potentially help quite a bit. We can leave it the way it is now.

  • jaavu

    Hi Imperative Ideas,

    You are asking me to spend the next 45min writing a guide, specifically for you.

    If you can, please guide me .

    I tried Cloudflare Free version with wordpress . Are there necessarry Wp cache pluign or W3TC plugin installation ?

    You really don't have to do a thing, except remember to put the site in "dev mode" when you are making changes and clear the cache after you reactivate.

    You mean i must installate cache plugin ( wp cache , W3TC ...)

  • jaavu

    Hi,

    I installated Cloudflare for my wordpress site : http://wordpress.org/plugins/cloudflare/

    I signed up free plan on https://www.cloudflare.com and get API Key .

    I inputed cloundflare API Key to Cloudflare in website.

    I check speed load of my website with : http://tools.pingdom.com/

    The result is nothing change , my speed load of website still don't change .

    Do i do anything wrong ?

    Thanks .

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.