Serve static assets with an efficient cache policy Error
-
My website is running really slow. I am trying to clear up some of the cache errors by using Google Lighthouse. I am seeing the error:
Serve static assets with an efficient cache policy
The error affects the .woff2 files in my theme.
…inter/Inter-upright-var.woff2
…fonts/nonbreakingspaceoverride.woff2There is no TTL set for these files although I have the browser cache turned on with a TTL of 31557600.
- This topic was modified 3 years, 10 months ago by deborah86.
The page I need help with: [log in to see the link]
-
Hi,
Did you enable browser cache ?
and also please provide the report number , you can get it in toolbox -> report -> click “send to LiteSpeed”
Best regards,
To repeat myself:
There is no TTL set for these files although I have the browser cache turned on with a TTL of 31557600.
I am unable to generate a report number. Here is the information below:
Server Variables SERVER_SOFTWARE = LiteSpeed DOCUMENT_ROOT = /home/dhosting.com/deborah86/t.dhostingsites.com/public_html X-LSCACHE = on,crawler,esi LSWCP_TAG_PREFIX = 9fe WP_SITEURL = NULL WP_HOME = NULL WP_CONTENT_DIR = /home/dhosting.com/deborah86/t.dhostingsites.com/public_html/wp-content SHORTINIT = false LSCWP_CONTENT_DIR = /home/dhosting.com/deborah86/t.dhostingsites.com/public_html/wp-content LSCWP_CONTENT_FOLDER = wp-content LSCWP_DIR = /home/dhosting.com/deborah86/t.dhostingsites.com/public_html/wp-content/plugins/litespeed-cache/ LITESPEED_TIME_OFFSET = -28800.0 LITESPEED_SERVER_TYPE = LITESPEED_SERVER_ENT LITESPEED_CLI = NULL LITESPEED_ALLOWED = true LITESPEED_ON = true LSWCP_TAG_PREFIX = 9fe COOKIEHASH = 1009d6fd44e5ce417312aa9249dc5320 Wordpress Specific Extras wordpress version = 5.6 siteurl = https://t.dhostingsites.com home = https://t.dhostingsites.com home_url = https://t.dhostingsites.com locale = en_US active theme = Twenty Twenty active plugins = array ( 0 => 'amp/amp.php', 1 => 'bbpress/bbpress.php', 2 => 'bing-webmaster-tools/bing-url-submission.php', 3 => 'buddypress/bp-loader.php', 4 => 'cartflows/cartflows.php', 6 => 'facebook-for-woocommerce/facebook-for-woocommerce.php', 7 => 'facebook-messenger-customer-chat/facebook-messenger-customer-chat.php', 9 => 'gamipress-activity-by-category/gamipress-activity-by-category.php', 10 => 'gamipress-bbpress-integration/gamipress-bbpress.php', 11 => 'gamipress-block-users/gamipress-block-users.php', 12 => 'gamipress-buddypress-integration/gamipress-buddypress.php', 13 => 'gamipress-button/gamipress-button.php', 14 => 'gamipress-emails-by-type/gamipress-emails-by-type.php', 15 => 'gamipress-h5p-integration/gamipress-h5p-integration.php', 16 => 'gamipress-jetpack-integration/gamipress-jetpack-integration.php', 17 => 'gamipress-learndash-integration/gamipress-learndash.php', 18 => 'gamipress-learndash-points-importer/gamipress-learndash-points-importer.php', 19 => 'gamipress-link/gamipress-link.php', 20 => 'gamipress-multimedia-content/gamipress-multimedia-content.php', 21 => 'gamipress-reset-user/gamipress-reset-users.php', 22 => 'gamipress-wc-points-per-purchase-total/gamipress-wc-points-per-purchase-total.php', 23 => 'gamipress-woocommerce-integration/gamipress-woocommerce.php', 24 => 'gamipress/gamipress.php', 25 => 'google-site-kit/google-site-kit.php', 26 => 'h5p/h5p.php', 27 => 'health-check/health-check.php', 28 => 'if-so/if-so.php', 29 => 'jetpack/jetpack.php', 30 => 'learndash-bbpress/learndash-bbpress.php', 31 => 'learndash-course-grid/learndash_course_grid.php', 32 => 'learndash-notifications/learndash-notifications.php', 33 => 'learndash-propanel/learndash_propanel.php', 34 => 'learndash-woocommerce/learndash_woocommerce.php', 35 => 'litespeed-cache/litespeed-cache.php', 36 => 'official-facebook-pixel/facebook-for-wordpress.php', 37 => 'pwa-for-wp/pwa-for-wp.php', 38 => 'sender-net-automated-emails/sender-net-automated-emails.php', 39 => 'sfwd-lms/sfwd_lms.php', 40 => 'web-stories/web-stories.php', 42 => 'woo-cart-abandonment-recovery/woo-cart-abandonment-recovery.php', 43 => 'woo-gutenberg-products-block/woocommerce-gutenberg-products-block.php', 44 => 'woocommerce-admin/woocommerce-admin.php', 45 => 'woocommerce-google-analytics-integration/woocommerce-google-analytics-integration.php', 46 => 'woocommerce-payments/woocommerce-payments.php', 47 => 'woocommerce/woocommerce.php', 49 => 'zero-bs-crm/ZeroBSCRM.php', ) cloud = array ( 'curr_request.wp/ver' => 0, 'last_request.wp/ver' => 1609322644, 'news.utime' => 1608259405, 'curr_request.wp/news' => 0, 'last_request.wp/news' => 1608259405, 'token_ts' => 1608491042, 'is_linked' => 1, 'apikey_ts' => 1608491123, 'curr_request.d/sync_conf' => 0, 'last_request.d/sync_conf' => 1609375897, 'curr_request.d/usage' => 0, 'last_request.d/usage' => 1609279194, 'usage.img_optm' => array ( 'total_used' => '217', 'used' => '217', 'quota' => '10000', 'pag_used' => '0', 'pag_bal' => '0', 'pkgs' => '4', ), 'usage.ccss' => array ( 'total_used' => '0', 'used' => '0', 'quota' => '1000', 'pag_used' => '0', 'pag_bal' => '0', 'pkgs' => '4', ), 'usage.lqip' => array ( 'total_used' => '38', 'used' => '38', 'quota' => '1000', 'pag_used' => '0', 'pag_bal' => '0', 'pkgs' => '4', ), 'usage.cdn' => array ( 'total_used' => '0', 'used' => '0', 'quota' => '100', 'pag_used' => '0', 'pag_bal' => '0', 'pkgs' => '4', ), 'usage.health' => array ( 'total_used' => '2', 'used' => '2', 'quota' => '1000', 'pag_used' => '0', 'pag_bal' => '0', 'pkgs' => '4', ), 'curr_request.d/regionnodes' => 0, 'last_request.d/regionnodes' => 1609188293, 'server.img_optm' => 'https://node119.quic.cloud', 'server_date.img_optm' => 1609188295, 'curr_request.img_optm-new_req' => 0, 'last_request.img_optm-new_req' => 1609338529, 'curr_request.img_optm-taken' => 0, 'last_request.img_optm-taken' => 1609338591, 'curr_request.d/nodes' => 0, 'last_request.d/nodes' => 1609342490, 'server.lqip' => 'https://node1.quic.cloud', 'server_date.lqip' => 1609166882, 'curr_request.lqip' => 0, 'last_request.lqip' => 1609339008, 'server.health' => 'https://node1.quic.cloud', 'server_date.health' => 1609342491, 'curr_request.health-score' => 0, 'last_request.health-score' => 1609342491, ) LSCache Plugin Options _version = 3.6.1 hash = SmJUrX6tJk7TRbB7iXvvJenXCIXhno9g auto_upgrade = true api_key = 62170EB837A3A80BB673A606464892C4 server_ip = 23.105.163.113 news = false cache = true cache-priv = true cache-commenter = true cache-rest = true cache-page_login = true cache-favicon = true cache-resources = true cache-mobile = true cache-mobile_rules = array ( 0 => 'Mobile', 1 => 'Android', 2 => 'Silk/', 3 => 'Kindle', 4 => 'BlackBerry', 5 => 'Opera Mini', 6 => 'Opera Mobi', ) cache-browser = true cache-exc_useragents = array ( ) cache-exc_cookies = array ( ) cache-exc_qs = array ( ) cache-exc_cat = array ( ) cache-exc_tag = array ( ) cache-force_uri = array ( ) cache-force_pub_uri = array ( ) cache-priv_uri = array ( ) cache-exc = array ( ) cache-exc_roles = array ( ) cache-drop_qs = array ( 0 => 'fbclid', 1 => 'gclid', 2 => 'utm*', 3 => '_ga', ) cache-ttl_pub = 604800 cache-ttl_priv = 1800 cache-ttl_frontpage = 604800 cache-ttl_feed = 604800 cache-ttl_rest = 604800 cache-ttl_browser = 31557600 cache-ttl_status = array ( 0 => '403 3600', 1 => '404 3600', 2 => '500 3600', ) cache-login_cookie = cache-vary_group = array ( 'administrator' => '99', 'author' => '0', 'bbp_blocked' => '0', 'bbp_keymaster' => '0', 'bbp_moderator' => '0', 'bbp_participant' => '0', 'bbp_spectator' => '0', 'contributor' => '0', 'customer' => '0', 'editor' => '0', 'group_leader' => '0', 'shop_manager' => '0', 'subscriber' => '0', 'zerobs_admin' => '0', 'zerobs_customer' => '0', 'zerobs_customermgr' => '0', 'zerobs_invoicemgr' => '0', 'zerobs_mailmgr' => '0', 'zerobs_quotemgr' => '0', 'zerobs_transactionmgr' => '0', ) purge-upgrade = true purge-stale = false purge-post_all = false purge-post_f = true purge-post_h = true purge-post_p = true purge-post_pwrp = true purge-post_a = true purge-post_y = false purge-post_m = true purge-post_d = false purge-post_t = true purge-post_pt = true purge-timed_urls = array ( ) purge-timed_urls_time = purge-hook_all = array ( 0 => 'switch_theme', 1 => 'wp_create_nav_menu', 2 => 'wp_update_nav_menu', 3 => 'wp_delete_nav_menu', 4 => 'create_term', 5 => 'edit_terms', 6 => 'delete_term', 7 => 'add_link', 8 => 'edit_link', 9 => 'delete_link', ) esi = false esi-cache_admbar = true esi-cache_commform = true esi-nonce = array ( 0 => 'stats_nonce', 1 => 'subscribe_nonce', ) util-instant_click = false util-no_https_vary = false debug-disable_all = true debug = 0 debug-ips = array ( 0 => '127.0.0.1', ) debug-level = false debug-filesize = 3 debug-cookie = false debug-collaps_qs = false debug-inc = array ( ) debug-exc = array ( ) db_optm-revisions_max = 50 db_optm-revisions_age = 30 optm-css_min = true optm-css_comb = true optm-css_comb_ext_inl = true optm-ucss = false optm-ucss_async = false optm-css_http2 = true optm-css_exc = array ( ) optm-js_min = true optm-js_comb = true optm-js_comb_ext_inl = true optm-js_http2 = true optm-js_exc = array ( 0 => 'jquery.js', 1 => 'jquery.min.js', ) optm-ttl = 604800 optm-html_min = true optm-qs_rm = false optm-ggfonts_rm = false optm-css_async = true optm-ccss_gen = true optm-ccss_async = true optm-css_async_inline = true optm-css_font_display = 2 optm-js_defer = true optm-js_inline_defer = 2 optm-emoji_rm = true optm-noscript_rm = true optm-ggfonts_async = true optm-exc_roles = array ( ) optm-ccss_con = optm-js_defer_exc = array ( 0 => 'jquery.js', 1 => 'jquery.min.js', ) optm-dns_prefetch = array ( ) optm-dns_prefetch_ctrl = true optm-exc = array ( ) optm-ccss_sep_posttype = array ( ) optm-ccss_sep_uri = array ( ) object = true object-kind = false object-host = localhost object-port = 11211 object-life = 360 object-persistent = true object-admin = true object-transients = false object-db_id = 0 object-user = object-pswd = object-global_groups = array ( 0 => 'users', 1 => 'userlogins', 2 => 'usermeta', 3 => 'user_meta', 4 => 'site-transient', 5 => 'site-options', 6 => 'site-lookup', 7 => 'blog-lookup', 8 => 'blog-details', 9 => 'rss', 10 => 'global-posts', 11 => 'blog-id-cache', ) object-non_persistent_groups = array ( 0 => 'comment', 1 => 'counts', 2 => 'plugins', 3 => 'wc_session_id', ) discuss-avatar_cache = true discuss-avatar_cron = true discuss-avatar_cache_ttl = 604800 optm-localize = true optm-localize_domains = array ( 0 => '### some CDNs', 1 => 'https://ajax.aspnetcdn.com', 2 => 'https://ajax.cloudflare.com/', 3 => 'https://ajax.googleapis.com/ajax/', 4 => 'https://cdn.jsdelivr.net/', 5 => 'https://cdnjs.com/', 6 => 'https://cdnjs.cloudflare.com/', 7 => 'https://code.jquery.com/', 8 => 'https://maxcdn.bootstrapcdn.com/', 9 => 'https://netdna.bootstrapcdn.com/', 10 => 'https://oss.maxcdn.com/', 11 => 'https://stackpath.bootstrapcdn.com/', 12 => '### Popular scripts ###', 13 => 'https://a.optmnstr.com/app/js/', 14 => 'https://cdn.onesignal.com/sdks/', 15 => 'https://cdn.optimizely.com/', 16 => 'https://cdn.shopify.com/s/', 17 => 'https://css3-mediaqueries-js.googlecode.com/svn/', 18 => 'https://html5shim.googlecode.com/svn/', 19 => 'https://html5shiv.googlecode.com/svn/', 20 => 'https://maps.google.com/maps/api/js', 21 => 'https://maps.googleapis.com/maps/api/js', 22 => 'https://pagead2.googlesyndication.com/pagead/js/', 23 => 'https://platform.twitter.com/widgets.js', 24 => 'https://platform-api.sharethis.com/js/', 25 => 'https://s7.addthis.com/js/', 26 => 'https://stats.wp.com/', 27 => 'https://ws.sharethis.com/button/', 28 => 'https://www.google.com/recaptcha/api.js', 29 => 'https://www.google-analytics.com/analytics.js', 30 => 'https://www.googletagmanager.com/gtag/js', 31 => 'https://www.googletagmanager.com/gtm.js', 32 => 'https://www.googletagservices.com/tag/js/gpt.js', 33 => 'https://connect.facebook.net/en_US/fbevents.js', 34 => 'https://connect.facebook.net/signals/config/', ) media-lazy = true media-lazy_placeholder = media-placeholder_resp = true media-placeholder_resp_color = #cfd4db media-placeholder_resp_svg = <svg xmlns="https://www.w3.org/2000/svg" width="{width}" height="{height}" viewBox="0 0 {width} {height}"><rect width="100%" height="100%" fill="{color}"/></svg> media-lqip = true media-lqip_qual = 4 media-lqip_min_w = 150 media-lqip_min_h = 150 media-placeholder_resp_async = true media-iframe_lazy = true media-lazyjs_inline = true media-lazy_exc = array ( ) media-lazy_cls_exc = array ( 0 => 'wmu-preview-img', ) media-lazy_parent_cls_exc = array ( ) media-iframe_lazy_cls_exc = array ( ) media-iframe_lazy_parent_cls_exc = array ( ) media-lazy_uri_exc = array ( ) media-lqip_exc = array ( 0 => 'https://t.dhostingsites.com/wp-content/uploads/work-4997565.svg', 1 => 'https://t.dhostingsites.com/wp-content/uploads/test-image-1-1024x614.jpg.webp', 2 => 'https://t.dhostingsites.com/wp-content/uploads/test-image-1-1024x614.jpg', 3 => 'https://t.dhostingsites.com/wp-content/uploads/woocommerce-placeholder-450x450.png', 4 => 'https://t.dhostingsites.com/wp-content/uploads/2020/12/entrepreneur-2557104_1920-1568x1046.jpg', 5 => '//www.gravatar.com/avatar/9de464fcf6c40d5240822138f07cd28a?s=150&r=g', 6 => '//www.gravatar.com/avatar/9de464fcf6c40d5240822138f07cd28a?s=160&r=g', 7 => 'https://t.dhostingsites.com/wp-content/uploads/trophy-153395-1.svg', 8 => 'https://t.dhostingsites.com/wp-content/uploads/borders-1295073.svg', 9 => 'https://t.dhostingsites.com/wp-content/uploads/tool-box-152145.svg', 10 => 'https://t.dhostingsites.com/wp-content/uploads/trophy-153395.svg', 11 => 'https://t.dhostingsites.com/wp-content/uploads/borders-1295073-1.svg', 12 => 'https://t.dhostingsites.com/wp-content/uploads/newspaper-1389980.svg', 13 => 'https://t.dhostingsites.com/wp-content/uploads/online-office-5757587.svg', 14 => 'https://t.dhostingsites.com/wp-content/uploads/template-1599667.svg', 15 => 'https://t.dhostingsites.com/wp-content/uploads/2020-12-30-300x169.png', ) img_optm-auto = true img_optm-cron = true img_optm-ori = true img_optm-rm_bkup = false img_optm-webp = true img_optm-lossless = false img_optm-exif = false img_optm-webp_replace = true img_optm-webp_attr = array ( 0 => 'img.src', 1 => 'div.data-thumb', 2 => 'img.data-src', 3 => 'div.data-large_image', 4 => 'img.retina_logo_url', ) img_optm-webp_replace_srcset = false img_optm-jpg_quality = 82 crawler = true crawler-usleep = 500 crawler-run_duration = 400 crawler-run_interval = 600 crawler-crawl_interval = 302400 crawler-threads = 3 crawler-timeout = 30 crawler-load_limit = 1 crawler-sitemap = https://t.dhostingsites.com/sitemap.xml crawler-drop_domain = true crawler-map_timeout = 120 crawler-roles = array ( ) crawler-cookies = array ( ) misc-htaccess_front = misc-htaccess_back = misc-heartbeat_front = false misc-heartbeat_front_ttl = 60 misc-heartbeat_back = false misc-heartbeat_back_ttl = 60 misc-heartbeat_editor = false misc-heartbeat_editor_ttl = 15 cdn = false cdn-ori = array ( 0 => '//t.dhostingsites.com/', ) cdn-ori_dir = array ( 0 => 'wp-content', 1 => 'wp-includes', 2 => '/min/', ) cdn-exc = array ( ) cdn-quic = true cdn-cloudflare = false cdn-cloudflare_email = cdn-cloudflare_key = cdn-cloudflare_name = cdn-cloudflare_zone = cdn-mapping = array ( 0 => array ( 'url' => '', 'inc_img' => '1', 'inc_css' => '1', 'inc_js' => '1', 'filetype' => array ( 0 => '.aac', 1 => '.css', 2 => '.eot', 3 => '.gif', 4 => '.jpeg', 5 => '.js', 6 => '.jpg', 7 => '.less', 8 => '.mp3', 9 => '.mp4', 10 => '.ogg', 11 => '.otf', 12 => '.pdf', 13 => '.png', 14 => '.svg', 15 => '.ttf', 16 => '.woff', ), ), ) cdn-attr = array ( 0 => '.src', 1 => '.data-src', 2 => '.href', 3 => '.poster', 4 => 'source.srcset', ) _cache = true /home/dhosting.com/deborah86/t.dhostingsites.com/public_html/.htaccess contents: # BEGIN LSCACHE ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ## <IfModule LiteSpeed> RewriteEngine on CacheLookup on RewriteRule .* - [E=Cache-Control:no-autoflush] RewriteRule \.object-cache\.ini - [F,L] ### marker MOBILE start ### RewriteCond %{HTTP_USER_AGENT} Mobile|Android|Silk/|Kindle|BlackBerry|Opera\ Mini|Opera\ Mobi [NC] RewriteRule .* - [E=Cache-Control:vary=ismobile] ### marker MOBILE end ### ### marker CACHE RESOURCE start ### RewriteRule wp-content/.*/[^/]*(responsive|css|js|dynamic|loader|fonts)\.php - [E=cache-control:max-age=3600] ### marker CACHE RESOURCE end ### ### marker FAVICON start ### RewriteRule favicon\.ico$ - [E=cache-control:max-age=86400] ### marker FAVICON end ### ### marker WEBP start ### RewriteCond %{HTTP_ACCEPT} "image/webp" [or] RewriteCond %{HTTP_USER_AGENT} "Page Speed" RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+webp] RewriteCond %{HTTP_USER_AGENT} iPhone.*Version/(\d{2}).*Safari RewriteCond %1 >13 RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+webp] ### marker WEBP end ### ### marker DROPQS start ### CacheKeyModify -qs:fbclid CacheKeyModify -qs:gclid CacheKeyModify -qs:utm* CacheKeyModify -qs:_ga ### marker DROPQS end ### </IfModule> ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ## # END LSCACHE # BEGIN NON_LSCACHE ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ## ### marker BROWSER CACHE start ### <IfModule mod_expires.c> ExpiresActive on ExpiresByType application/pdf A31557600 ExpiresByType image/x-icon A31557600 ExpiresByType image/vnd.microsoft.icon A31557600 ExpiresByType image/svg+xml A31557600 ExpiresByType image/jpg A31557600 ExpiresByType image/jpeg A31557600 ExpiresByType image/png A31557600 ExpiresByType image/gif A31557600 ExpiresByType image/webp A31557600 ExpiresByType video/ogg A31557600 ExpiresByType audio/ogg A31557600 ExpiresByType video/mp4 A31557600 ExpiresByType video/webm A31557600 ExpiresByType text/css A31557600 ExpiresByType text/javascript A31557600 ExpiresByType application/javascript A31557600 ExpiresByType application/x-javascript A31557600 ExpiresByType application/x-font-ttf A31557600 ExpiresByType application/x-font-woff A31557600 ExpiresByType application/font-woff A31557600 ExpiresByType application/font-woff2 A31557600 ExpiresByType application/vnd.ms-fontobject A31557600 ExpiresByType font/ttf A31557600 ExpiresByType font/woff A31557600 ExpiresByType font/woff2 A31557600 </IfModule> ### marker BROWSER CACHE end ### ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ## # END NON_LSCACHE # 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
Check your .htaccess configuration for
Header set Cache-Control
To set efficient cache control for static sources add following define if it doesn’t exists:
<FilesMatch "\.(jpg|JPG|jpeg|woff|woff2|png|gif|swf|ico|js|css|ttf|eot|ico|svg)$"> Header set Cache-Control "max-age=31536000, public" </FilesMatch>
No. I don’t see theme. How was I supposed to know I needed these fields to get the plugin to work?
The plugin should automatically add those values if they or not present. It should mention the user needs these fields in the documentation. This is misleading regarding the browser cache.
- This reply was modified 3 years, 10 months ago by deborah86.
Browser cache has nothing to do with LScache plugin for WordPress. Browser cache is on client side, LScache plugin is server side. 2 completey different kind of caching. If it is missing in .htaccess WordPress should add this cache header because it is a standard cache header for every web application.
Add this header and you will get what Litehouse is missing.
- The topic ‘Serve static assets with an efficient cache policy Error’ is closed to new replies.