### Delete Cache via WP CLI Source: https://speedycache.com/docs/caching/how-to-delete-cache-or-minified-files Use this command to delete the cache when you have WP CLI installed on your server. ```bash wp speedycache clear cache ``` -------------------------------- ### Enable GZIP compression in Nginx configuration Source: https://speedycache.com/docs/miscellaneous/how-to-enable-gzip-on-nginx Paste this configuration inside the http block of /etc/nginx/nginx.conf. Replace any existing gzip configuration. After saving, restart Nginx to enable GZIP compression for your website. ```nginx gzip on; gzip_vary on; gzip_proxied any; gzip_comp_level 6; gzip_buffers 16 8k; gzip_http_version 1.1; gzip_types image/svg+xml text/plain text/html text/xml text/css text/javascript application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript application/x-font-ttf application/vnd.ms-fontobject font/opentype font/ttf font/eot font/otf; ``` -------------------------------- ### Cron job command to trigger wp-cron.php Source: https://speedycache.com/docs/caching/running-cache-lifespan-at-specific-time Use this command in your control panel's cron job to run every 5 minutes or as needed. It fetches wp-cron.php with the doing_wp_cron parameter and discards output, ensuring cache lifespan runs even without site visitors. ```bash wget -q -O - https://yourdomain.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1 ``` -------------------------------- ### Delete Cache and Minified JS/CSS via WP CLI Source: https://speedycache.com/docs/caching/how-to-delete-cache-or-minified-files Use this command to delete both the cache and minified JavaScript and CSS files. ```bash wp speedycache clear cache and minified ``` -------------------------------- ### Lazy Render Multiple HTML Elements with CSS Source: https://speedycache.com/docs/file-optimization/how-to-lazy-render-html-elements Use this CSS to lazy render multiple elements at once. It applies to the specified ID, class, and element type (aside). Replace the selectors with your own. ```css #element_id, .element_class, aside{content-visibility:auto;contain-intrinsic-size:1px 1000px;} ``` -------------------------------- ### Nginx location block for browser caching Source: https://speedycache.com/docs/caching/how-to-leverage-browser-caching-on-nginx Paste this code inside the server block of the Nginx configuration file at /etc/nginx/nginx.conf. It sets an expiration policy for static assets such as CSS, JS, images, and fonts. After saving, restart Nginx to apply the caching policy. ```nginx location ~* \.(css|js|ico|gif|jpeg|jpg|webp|png|svg|eot|otf|woff|woff2|ttf|ogg)$ { expires max; } ``` -------------------------------- ### Lazy Render a Single HTML Element with CSS Source: https://speedycache.com/docs/file-optimization/how-to-lazy-render-html-elements Add this CSS to your WordPress Customizer or theme CSS file to lazy render a single element. Replace #element_id with the ID of the element you want to lazy render. ```css #element_id{content-visibility:auto;contain-intrinsic-size:1px 1000px;} ``` -------------------------------- ### Disable WP-Cron in wp-config.php Source: https://speedycache.com/docs/caching/running-cache-lifespan-at-specific-time Add this constant to wp-config.php to prevent WP-Cron from running on user visits. This ensures the cache lifespan only runs via the real cron job you set up. ```php define('DISABLE_WP_CRON', true); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.