Hello @blenkhn
Thank you for reaching out and I am happy to assist you with this.
Can you please confirm if W3 Total Cache is activated?
The page is cached once visited, so if none of the pages are visited after the W3 Total Cache activation, they are not cached yet.
Also, besides W3 Total Cache, do you have any other plugin or custom rewrite rules in your .htaccess file?
Thanks!
I understand this. The problem is with the cached pages. The site is quite large 55k products if that would make a difference.
This is the contents of the .htaccess file. This is after removing all of w3tc.
#DO not remove this unless XMLRPC is required
<Files xmlrpc.php>
Order Allow,Deny
Deny from all
</Files>
# BEGIN rlrssslReallySimpleSSL rsssl_version[4.0.5]
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</IfModule>
# END rlrssslReallySimpleSSL
# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
<IfModule mod_expires.c>
ExpiresActive On
# Images
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
ExpiresByType image/x-icon "access plus 1 year"
# Video
ExpiresByType video/mp4 "access plus 1 year"
ExpiresByType video/mpeg "access plus 1 year"
# CSS, JavaScript
ExpiresByType text/css "access plus 1 month"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
# Others
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
</IfModule>
<Files 403.shtml>
order allow,deny
allow from all
</Files>
deny from 103.159.50.183
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php74” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php74 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
<IfModule php7_module>
php_flag display_errors Off
php_value max_execution_time 1000
php_value max_input_time 1000
php_value max_input_vars 10000
php_value memory_limit 12288M
php_value post_max_size 300M
php_value session.gc_maxlifetime 1440
php_value session.save_path "/var/cpanel/php/sessions/ea-php72"
php_value upload_max_filesize 300M
php_flag zlib.output_compression Off
</IfModule>
<IfModule lsapi_module>
php_flag display_errors Off
php_value max_execution_time 1000
php_value max_input_time 1000
php_value max_input_vars 10000
php_value memory_limit 12288M
php_value post_max_size 300M
php_value session.gc_maxlifetime 1440
php_value session.save_path "/var/cpanel/php/sessions/ea-php72"
php_value upload_max_filesize 300M
php_flag zlib.output_compression Off
</IfModule>
# END cPanel-generated php ini directives, do not edit
Hello @blenkhn
Thank you for the feedback.
You have some unnecessary rules in your .htaccess file. The expires header for images can also be set in W3 TOtal Cache Browser Cache option, however, if you choose to go with those custom rules, make sure to disable the expires header option for Media&other files.
As I said, the page is cached once visited, so if for example the cache is purged after some page or product update, the pages will not be cached again unless they are visited.
W3 Total Cache does have a Preload option in Performance>Page Cache>Cache Preload which you can enable and add the sitemap. Depending on the settings it will take time for the entire website to be preloaded, and please note that lowering the update interval and increasing the Pages per interval can end up using a lot of server resources, so the default settings are recommended.
I hope this helps!
Thanks!
Hi Marko,
Regarding “W3 Total Cache does have a Preload option in Performance>Page Cache>Cache Preload which you can enable and add the sitemap.”, is there a specific type/format of sitemap that W3TC use? Could you recommend a plugin that generates a compatible sitemap for use with W3TC?
Hello @francoc30
Thank you for your question.
You can use any sitemap – custom or plugin generated.
For example, if you are using Yoast SEO, you can use the sitemap generated which should look something like this https://yourwebsite.com/sitemap_index.xml
Thanks!
My website uses Chinese characters on pages and custom posts. All urls are in English. Will sitemap works with that for W3TC preloading?
Hello @francoc30
Thank you for your question.
Yes, the sitemap will work.
Thanks!