LiteSpeed es un servidor web de alto rendimiento, totalmente compatible con Apache pero significativamente mas rapido.
Su sistema de cache LSCache convierte contenido dinamico en estatico, reduciendo drasticamente los tiempos de carga.
Integracion nativa: LiteSpeed funciona de forma optimizada con WordPress, PrestaShop, Magento, Drupal, Joomla y mas.
Instala el plugin oficial de LSCache para tu CMS:
| CMS | Plugin |
|---|---|
| WordPress | LiteSpeed Cache |
| PrestaShop | PrestaShop Acceleration |
| Magento | Magento Acceleration |
| Joomla | Joomla Acceleration |
| Drupal | Drupal Acceleration |
| OpenCart | OpenCart Acceleration |
| XenForo | XenForo Acceleration |
| MediaWiki | MediaWiki Acceleration |
Gratis: Los plugins son gratuitos. GINERNET asume el coste de la licencia LiteSpeed.
Para vaciar la cache, usa el icono de LSCache en cPanel.
Si tu CMS no tiene plugin, usa estas directivas en .htaccess:
Cachear todo el contenido:
RewriteRule ^(.*) - [E=Cache-Control:max-age=86400]
Cachear un fichero especifico:
RewriteRule ^fichero.php$ - [E=Cache-Control:max-age=86400]
max-age=86400= 1 dia en segundos
El crawler rastrea automaticamente tu web para pre-cachear todas las paginas.
Requisito: Genera un sitemap con Yoast SEO (WordPress) o Google Sitemap (PrestaShop).
Configuracion:
bash /home/USUARIO/cachecrawler.sh -m URL_SITEMAP >/dev/null 2>&1
Ejemplo:
bash /home/ginernet/cachecrawler.sh -m https://ginernet.com/sitemap_index.xml >/dev/null 2>&1
| Opcion | Valor |
|---|---|
| Enable Cache | ON |
| Cache Logged-in Users | ON |
| Cache Commenters | ON |
| Cache REST API | ON |
| Cache Login Page | ON |
| Cache favicon.ico | OFF |
| Cache PHP Resources | OFF |
| Cache Mobile | OFF |
| Opcion | Valor |
|---|---|
| Instant Click | ON |
| Opcion | Valor |
|---|---|
| CSS Minify | OFF |
| CSS Combine | OFF |
| Load CSS Asynchronously | ON |
| CCSS Per URL | ON |
| Inline CSS Async Lib | ON |
| Font Display Optimization | Swap |
| Opcion | Valor |
|---|---|
| JS Minify | OFF |
| JS Combine | OFF |
| Load JS Deferred | OFF |
| Opcion | Valor |
|---|---|
| HTML Minify | ON |
| DNS Prefetch Control | ON |
Protege tu web con verificacion reCAPTCHA mediante .htaccess.
<IfModule LiteSpeed>
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^(CN|RU)$
RewriteRule .* - [E=verifycaptcha:drop][L]
</IfModule>
<IfModule LiteSpeed>
RewriteRule .* - [E=verifycaptcha:drop]
</IfModule>
<IfModule LiteSpeed>
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^(CN|RU)$
RewriteRule ^(.*)$ - [F,L]
</IfModule>
Modifica parametros PHP en .htaccess:
php_value max_execution_time 300
php_value memory_limit 2048M
php_value upload_max_filesize 2048M
php_value post_max_size 2048M
Verificar valores: Crea un archivo con <?php phpinfo(); ?>
Peligro: Estas directivas pueden saturar tu servidor. Usa solo si sabes lo que haces.
El timeout por defecto es 300 segundos.
<IfModule Litespeed>
RewriteEngine On
RewriteRule ^fichero\\.php$ - [E=noabort:1, E=noconntimeout:1]
RewriteRule ^directorio/ - [E=noabort:1, E=noconntimeout:1]
</IfModule>
Identificar el fichero problematico:
top -c
Advertencia: Solo usar en casos excepcionales.
<IfModule Litespeed>
RewriteEngine On
RewriteRule .* - [E=noabort:1, E=noconntimeout:1]
</IfModule>
# En la terminal de cPanel:
kill -9 -1