Skip to content

Instantly share code, notes, and snippets.

@panayotoff
Created August 20, 2019 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save panayotoff/3146a46e9b4eb587c130426167a65d00 to your computer and use it in GitHub Desktop.
Save panayotoff/3146a46e9b4eb587c130426167a65d00 to your computer and use it in GitHub Desktop.
RewriteEngine On
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{DOCUMENT_ROOT}/$1.webp -f
RewriteRule (.*)\-.*(jpe?g|png) $1.webp [T=image/webp,E=accept:1]
Source:
https://buttercms.com/blog/front-end-performance-optimization-techniques
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment