webpopular.net dark logo webpopular.net light logo webpopular.net mobile dark logo webpopular.net mobile light logo
  • Home
  • Services
    • App Development
    • Website Consulting
    • Website Design
    • WordPress Development
    • Search Engine Optimization
      • Search Engine Optimization
      • SEO Company Audit
      • Free SEO audit
      • Enterprise SEO audit
      • SEO technical audit service
      • WordPress SEO consultant
    • Social Media Marketing
    • ADA Web Development Compliance
    • Enterprise ADA Web Development Compliance
    • WordPress Maintenance & Support
    • WordPress Security
    • Web Hosting
  • Portfolio
  • Blog
  • Contact Us
  • (214) 282-3530
  • search
NextPrevious

How to leverage browser caching

A webpopular.net

article by: natalie| Website Performance| 0 comments| 20 March, 2019| 0

Add the following code to the beginning of your .htaccess file. Remember to back it up first!

 

<IfModule mod_deflate.c>
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml

# Remove browser bugs (only needed for really old browsers)
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent
</IfModule>

<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On
# Default directive
ExpiresDefault "access plus 1 month"
# My favicon
ExpiresByType image/x-icon "access plus 1 year"
# Images
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
# CSS
ExpiresByType text/css "access plus 1 month"
# Javascript
ExpiresByType application/javascript "access plus 1 year"
</IfModule>

If you need more help with other WordPress development or maintenance issues, see our how-to guides, blog posts, or contact us today to see how else we can help improve your website.

How-to

Leave a Comment

Cancel reply

Your email address will not be published. Required fields are marked *

NextPrevious

We are webpopular.net

Our team is ready to help you get started improving your business. We are here to help, whether you need a website created to reach a bigger audience, increase SEO for your site, or you simply want to improve your web design. We have a wide variety of services to cater to your needs!

Recent Posts

10 proven ways to grow your site traffic 2021

How to increase website traffic: a case study

Tips on getting more organic traffic to your site

Best free stock music sites for commercial use 2021

Services

Website Consulting

Website Design

WordPress Development

Search Engine Optimization

SEO Company Audit

Social Media Marketing

ADA Web Development Compliance

Enterprise ADA Web Development Compliance

WordPress Maintenance & Support

WordPress Security

Web Hosting

Contact Us

Facebook Twitter LinkedIn Instagram

Feel free to email us, call us, or fill out the form on our Contact page for more information.

Phone: 214-282-3530
Email: bbass@webpopular.net

Copyright © 2023 | All Rights Reserved

webpopular.net logo
  • Home
  • Services
    • App Development
    • Website Consulting
    • Website Design
    • WordPress Development
    • Search Engine Optimization
      • Search Engine Optimization
      • SEO Company Audit
      • Free SEO audit
      • Enterprise SEO audit
      • SEO technical audit service
      • WordPress SEO consultant
    • Social Media Marketing
    • ADA Web Development Compliance
    • Enterprise ADA Web Development Compliance
    • WordPress Maintenance & Support
    • WordPress Security
    • Web Hosting
  • Portfolio
  • Blog
  • Contact Us
  • (214) 282-3530
  • search
webpopular.net mobile logo