Skip to main content
Drupal 8

Main navigation

  • Home
    • Question And Answer
    • NEWS
    • Projects
  • Tutorials - Drupal
    • Android
    • Other
User account menu
  • Log in

Breadcrumb

  1. Home

SEO Cache-Control for browser caching

By editor , 27 October, 2016
Question

How to speed up the site by compressing and caching your content with .htaccess ?

How to use Apache Cache-Control for browser caching using .htaccess file ?

Example:

# BEGIN Cache-Control Headers
<ifModule mod_headers.c>
  #31104000=1Y, 2592000=1M, 604800=1W, 86400=1D 3600=1H
  # Icones, Images .... (ico|jpe?g|png|gif|swf)
  <filesMatch "\.(ico)$">
    Header set Cache-Control "max-age=2592000, public"
  </filesMatch>
  # Fonts
  <filesMatch "\.(eot|otf|svg|ttf|woff)$">
    Header set Cache-Control "max-age=31104000, public"
  </filesMatch>
</ifModule>

Tags

  • Server
  • SEO

Comments

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.

Links

  • Drupal.org
  • Drupal core release cycle
  • Drupal events with ease
  • Unit test with Drupal using PHPUnit (Drupal 10)
  • Tokens for file upload url
  • Tips for Docker
  • CKEditor inline image files usage for custom forms.
  • Install Docker on Linux Mint
  • Install PHP 8.1
  • Drupal Security Best Practices
  • Order and sort items with tabledrag
  • Add a custom service YAML container
  • Apply a patch with composer