SlideShare a Scribd company logo
Google Mobile First Index
Speed up your web / Apache / SEO
Emirodgar / https://emirodgar.com - @emirodgar
Optimize Apache http web server & web
Check Apache active modules
We need access through SSH in order to execute linux commands
Check Apache active modules with:
● apache2ctl -M
If not activated, we need to turn on expires and headers:
● a2enmod expires
● a2enmod headers
After that, we need to restart the server
● service apache2 restart
Apache .htaccess file
Now we need to edit .htaccess file which is located at the root of our site
(base www dir).
If it doesn’t exist, we can create it through FTP. After that we just need
to add some lines in order to speed up our site. We are going to active:
● Cache-control
● GZIP Compression
● Keep alive
● Etag
.htaccess set cache-control
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/js "access 1 month"
ExpiresByType text/html "access 1 day"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access plus 1 month"
</IfModule>
.htaccess set Etag
Etag helps to use cache memory in a more efficient way. It works like a digital print, it only changes when
a file has changed.
FileETag MTime Size
Check if it is working
.htaccess GZIP compression
<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>
Check if it is working
.htaccess set keep-alive
Allow to transfer multiple files between server and browser
<ifModule mod_headers.c>
Header set Connection keep-alive
</ifModule>
Check if it is working
.htaccess redirect errors to homepage
This code will help us to redirect all errors to the homepage. Use it carefully. It doesn’t affect the speed
but can help us to handle multiple errors.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /? [L,R=301]
.htaccess prevent hotlinking
As the previous point, it doesn’t affect the load time, but can help us to control our resources preventing
others sites to consume them.
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www.)?emirodgar.com [NC]
RewriteRule .(jpg|jpeg|png|gif|svg)$ https://domain.com/image.jpg [NC,R,L]
Optimize resources
In order to speed up we need to work with
optimized files:
● Compress HTML
● Compress CSS
● Compress JS
● Compress images
Compress and optimize HTML
Compress CSS
Select CSS used
Make sure you only include in your page the CSS styles you are actually
using in the site.
CSS Used is a Chrome plugin that will select the CSS you need (export &
create a new final file). Firefox has similar plugins with the same
functionality.
Compress Javascript
Compress images
We can use one of the several tools we have online:
● https://kraken.io/web-interface
● http://optimizilla.com
● https://compressor.io
● https://tinypng.com
Use a cookieless subdomain as CDN
Let’s create our own CDN (Content Delivery Network). You can also use some service as Cloudflare (free
and paid plans available).
● Create a subdomain of your own domain or use another domain
● Load static files as CSS, JS and images from this new access
Learn more about cookie free domains.
Use a cookieless subdomain as CDN - Analytics
If your are using Google Analytics, make sure you are not generating cookies on the CDN subdomain. For
that, set cookie_domain to none.
Install modpagespeed
You can also install mod_pagespeed in your server. Once installed, learn how to configure it.
cd /tmp
wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb
dpkg -i mod-pagespeed-stable_current_amd64.deb
Check if it is working
2018 Google Mobile First Index - Speed up Apache & Web for SEO
2018 Google Mobile First Index - Speed up Apache & Web for SEO
Google Mobile First Index
Speed up your web / Apache / SEO
Emirodgar / https://emirodgar.com - @emirodgar

More Related Content

PDF
WordPress Need For Speed
PDF
Building Scalable Websites with Perl
KEY
Using Apache as an Application Server
PDF
Introduction to performance tuning perl web applications
PPTX
Getting started with node.js
PDF
Service Worker Presentation
PPTX
Cook Infrastructure with chef -- Justeat.IN
WordPress Need For Speed
Building Scalable Websites with Perl
Using Apache as an Application Server
Introduction to performance tuning perl web applications
Getting started with node.js
Service Worker Presentation
Cook Infrastructure with chef -- Justeat.IN

What's hot (20)

PPTX
Best Practices for creating WP REST API by Galkin Nikita
PDF
How to investigate and recover from a security breach in WordPress
PDF
Altitude SF 2017: Advanced VCL: Shielding and Clustering
PPTX
007. Redux middlewares
PPTX
Capybara + RSpec - ruby dsl-based web ui qa automation
PPT
Speed Up Your Website
PDF
Asynchronous JavaScript loading
KEY
深入淺出RoR
PDF
ReactDC Intro to NextJS 9
PPTX
Hello world
ODP
Basic testing with selenium
PDF
Web Development with NodeJS
KEY
Composing re-useable ETL on Hadoop
PDF
Scaling PHP web apps
PPTX
Sins Against Drupal 1
PPTX
Altitude SF 2017: Fastly GSLB: Scaling your microservice and multi-cloud envi...
PDF
EWD 3 Training Course Part 11: Handling Errors in QEWD
PDF
EWD 3 Training Course Part 19: The cache.node APIs
PDF
Performance
PDF
Improve Magento Performance
Best Practices for creating WP REST API by Galkin Nikita
How to investigate and recover from a security breach in WordPress
Altitude SF 2017: Advanced VCL: Shielding and Clustering
007. Redux middlewares
Capybara + RSpec - ruby dsl-based web ui qa automation
Speed Up Your Website
Asynchronous JavaScript loading
深入淺出RoR
ReactDC Intro to NextJS 9
Hello world
Basic testing with selenium
Web Development with NodeJS
Composing re-useable ETL on Hadoop
Scaling PHP web apps
Sins Against Drupal 1
Altitude SF 2017: Fastly GSLB: Scaling your microservice and multi-cloud envi...
EWD 3 Training Course Part 11: Handling Errors in QEWD
EWD 3 Training Course Part 19: The cache.node APIs
Performance
Improve Magento Performance
Ad

Similar to 2018 Google Mobile First Index - Speed up Apache & Web for SEO (20)

PPTX
Joomla! Performance on Steroids
PPTX
Speed up Your Joomla Site for Ultimate Performance
PPTX
Breaking the Speed Limit: Faster Websites Win
PDF
WordPress Performance optimization
PDF
How to Speed Up Your Joomla Website
PDF
.htaccess Cheatsheet
PPTX
The Need for Speed - SMX Sydney 2013
PDF
How to Speed Up Your Joomla! Site
PDF
Web performance mercadolibre - ECI 2013
KEY
Page Performance
PDF
Website optimization
PDF
Web performance optimization - MercadoLibre
PDF
23 Ways To Speed Up WordPress
PDF
How do you speed up your (Wordpress) website?
PDF
Performance tuning of Websites
PPTX
Analysis of Google Page Speed Insight
PDF
Speed Matters
PDF
Optimizing Your Frontend Performance
PDF
Tuning web performance
PDF
Tuning Web Performance
Joomla! Performance on Steroids
Speed up Your Joomla Site for Ultimate Performance
Breaking the Speed Limit: Faster Websites Win
WordPress Performance optimization
How to Speed Up Your Joomla Website
.htaccess Cheatsheet
The Need for Speed - SMX Sydney 2013
How to Speed Up Your Joomla! Site
Web performance mercadolibre - ECI 2013
Page Performance
Website optimization
Web performance optimization - MercadoLibre
23 Ways To Speed Up WordPress
How do you speed up your (Wordpress) website?
Performance tuning of Websites
Analysis of Google Page Speed Insight
Speed Matters
Optimizing Your Frontend Performance
Tuning web performance
Tuning Web Performance
Ad

More from Emilio Rodríguez García (20)

PPTX
[PIAMD] US2. El futuro de los buscadores y las redes sociales en la era de la IA
PPTX
Brain & Code - Las novedades del algoritmo de Google.pptx
PPTX
Webinar - Smartup - ¿Cómo será el SEO en 2020?
PPTX
USAL - Masterclass - Analítica web 2021
PPTX
Big Data + Marketing Digital
PPTX
Google Analytics 4 - Webinar (Smartup)
PPTX
Bases de datos NoSQL en entornos Big Data
PPTX
Exprimiendo Google Analytics
PPTX
Técnicas de análisis de datos
PPTX
Analítica y medición digital
PPTX
Business intelligence vs experiencia de usuario
PPTX
Business intelligence
PPTX
Inbound marketing
PPTX
PPTX
Plan de marketing digital
PPTX
Identidad digital y reputación online
PPTX
Capa de negocios tecnológicos - Modelos de negocios (IV)
PPTX
Los números también importan - Modelos de negocio (III)
PPTX
Modelos de negocio en la era digital - Modelos de negocio (II)
PPTX
Introducción a la transformación digital - Modelos de negocio (I)
[PIAMD] US2. El futuro de los buscadores y las redes sociales en la era de la IA
Brain & Code - Las novedades del algoritmo de Google.pptx
Webinar - Smartup - ¿Cómo será el SEO en 2020?
USAL - Masterclass - Analítica web 2021
Big Data + Marketing Digital
Google Analytics 4 - Webinar (Smartup)
Bases de datos NoSQL en entornos Big Data
Exprimiendo Google Analytics
Técnicas de análisis de datos
Analítica y medición digital
Business intelligence vs experiencia de usuario
Business intelligence
Inbound marketing
Plan de marketing digital
Identidad digital y reputación online
Capa de negocios tecnológicos - Modelos de negocios (IV)
Los números también importan - Modelos de negocio (III)
Modelos de negocio en la era digital - Modelos de negocio (II)
Introducción a la transformación digital - Modelos de negocio (I)

Recently uploaded (20)

PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
cuic standard and advanced reporting.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Approach and Philosophy of On baking technology
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Encapsulation theory and applications.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Electronic commerce courselecture one. Pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Dropbox Q2 2025 Financial Results & Investor Presentation
cuic standard and advanced reporting.pdf
Programs and apps: productivity, graphics, security and other tools
Approach and Philosophy of On baking technology
The AUB Centre for AI in Media Proposal.docx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Review of recent advances in non-invasive hemoglobin estimation
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Mobile App Security Testing_ A Comprehensive Guide.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
MYSQL Presentation for SQL database connectivity
Encapsulation theory and applications.pdf
Unlocking AI with Model Context Protocol (MCP)
Network Security Unit 5.pdf for BCA BBA.
Electronic commerce courselecture one. Pdf
Digital-Transformation-Roadmap-for-Companies.pptx

2018 Google Mobile First Index - Speed up Apache & Web for SEO

  • 1. Google Mobile First Index Speed up your web / Apache / SEO Emirodgar / https://emirodgar.com - @emirodgar
  • 2. Optimize Apache http web server & web
  • 3. Check Apache active modules We need access through SSH in order to execute linux commands Check Apache active modules with: ● apache2ctl -M If not activated, we need to turn on expires and headers: ● a2enmod expires ● a2enmod headers After that, we need to restart the server ● service apache2 restart
  • 4. Apache .htaccess file Now we need to edit .htaccess file which is located at the root of our site (base www dir). If it doesn’t exist, we can create it through FTP. After that we just need to add some lines in order to speed up our site. We are going to active: ● Cache-control ● GZIP Compression ● Keep alive ● Etag
  • 5. .htaccess set cache-control <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/jpg "access 1 year" ExpiresByType image/jpeg "access 1 year" ExpiresByType image/gif "access 1 year" ExpiresByType image/png "access 1 year" ExpiresByType text/css "access 1 month" ExpiresByType text/js "access 1 month" ExpiresByType text/html "access 1 day" ExpiresByType application/pdf "access 1 month" ExpiresByType text/x-javascript "access 1 month" ExpiresByType image/x-icon "access 1 year" ExpiresDefault "access plus 1 month" </IfModule>
  • 6. .htaccess set Etag Etag helps to use cache memory in a more efficient way. It works like a digital print, it only changes when a file has changed. FileETag MTime Size
  • 7. Check if it is working
  • 8. .htaccess GZIP compression <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>
  • 9. Check if it is working
  • 10. .htaccess set keep-alive Allow to transfer multiple files between server and browser <ifModule mod_headers.c> Header set Connection keep-alive </ifModule>
  • 11. Check if it is working
  • 12. .htaccess redirect errors to homepage This code will help us to redirect all errors to the homepage. Use it carefully. It doesn’t affect the speed but can help us to handle multiple errors. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /? [L,R=301]
  • 13. .htaccess prevent hotlinking As the previous point, it doesn’t affect the load time, but can help us to control our resources preventing others sites to consume them. RewriteEngine On RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http(s)?://(www.)?emirodgar.com [NC] RewriteRule .(jpg|jpeg|png|gif|svg)$ https://domain.com/image.jpg [NC,R,L]
  • 14. Optimize resources In order to speed up we need to work with optimized files: ● Compress HTML ● Compress CSS ● Compress JS ● Compress images
  • 17. Select CSS used Make sure you only include in your page the CSS styles you are actually using in the site. CSS Used is a Chrome plugin that will select the CSS you need (export & create a new final file). Firefox has similar plugins with the same functionality.
  • 19. Compress images We can use one of the several tools we have online: ● https://kraken.io/web-interface ● http://optimizilla.com ● https://compressor.io ● https://tinypng.com
  • 20. Use a cookieless subdomain as CDN Let’s create our own CDN (Content Delivery Network). You can also use some service as Cloudflare (free and paid plans available). ● Create a subdomain of your own domain or use another domain ● Load static files as CSS, JS and images from this new access Learn more about cookie free domains.
  • 21. Use a cookieless subdomain as CDN - Analytics If your are using Google Analytics, make sure you are not generating cookies on the CDN subdomain. For that, set cookie_domain to none.
  • 22. Install modpagespeed You can also install mod_pagespeed in your server. Once installed, learn how to configure it. cd /tmp wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb dpkg -i mod-pagespeed-stable_current_amd64.deb
  • 23. Check if it is working
  • 26. Google Mobile First Index Speed up your web / Apache / SEO Emirodgar / https://emirodgar.com - @emirodgar

Editor's Notes

  • #7: Link: https://httpd.apache.org/docs/2.4/es/mod/core.html
  • #11: Link: https://abdussamad.com/archives/169-Apache-optimization:-KeepAlive-On-or-Off.html
  • #26: Check server response: https://www.sumologic.com/apache/analyzing-response-time/