Comments (8)
Some complements ?
Gzip seems already activated, but, who knows.
<IfModule mod_deflate.c>
# Enables Gzip compression.
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/css application/x-javascript
</IfModule>
# Prevents browsing directories.
Options -Indexes
from ecoindex.
Done. Efficient client-side caching and network compression.
from ecoindex.
Voici le .htaccess au complet :
AuthUserFile /home/ecoindex.neutral.hosting/public_html/.htpasswd
AuthType Basic
AuthName "Accès réservé"
Require valid-user
RewriteEngine On
# redirect result without params to to 404
RewriteCond %{REQUEST_URI} ^/resultat/index\.html$
RewriteCond %{QUERY_STRING} !(^|&)id($|&)
RewriteRule ^(.*)$ /404.html? [L,R=301]
# prevent bandwith theft from assets
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?:\/\/(.+\.)?ecoindex\.(fr|neutral\.hosting) [NC]
RewriteRule .*\.(jp(e)?g|gif|bmp|png|svg|mp4|webm)$ https://imgur.com/ZtXiCBw.gif [L,R]
# enforce https
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# remove www
RewriteCond %{HTTP_HOST} ^www\.example\.com [NC]
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
# Don't allow anyone to see my .htaccess file
<Files .htaccess>
Order allow,deny
Deny from all
</Files>
<IfModule mod_expires.c>
# Sets or disables the cache.
ExpiresActive On
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
</IfModule>
<IfModule mod_headers.c>
# Sets or disables the cache.
<filesMatch "\.(jpe?g|png|svg|css|js)$">
Header set Cache-Control "max-age=31536000, public"
</filesMatch>
</IfModule>
<IfModule mod_deflate.c>
# Enables Gzip compression.
SetOutputFilter DEFLATE
AddOutputFilterByType DEFLATE text/html text/css application/x-javascript image/svg+xml
</IfModule>
# Prevents browsing directories.
Options -Indexes
ErrorDocument 404 /404/
from ecoindex.
(we could add gzip on svg if we plan to load svg as external resources)
from ecoindex.
Updated on prod.
Comment updated: #103 (comment)
from ecoindex.
(we could add gzip on svg if we plan to load svg as external resources)
We do that for the logos right? (or externally means "from another server"?)
from ecoindex.
Gzip compression will only apply to resources loaded by the network (like <img src="logo.svg" />
, for a svg).
We could add it, just in case (the same logic apply to caching).
from ecoindex.
Yes 👍
- EcoIndex logo :
<img src="/images/logo.svg" width="132" height="36" alt="ecoIndex, retour à la page d’accueil">
- Green IT logo :
<img src="/images/logo-greenit.png" width="126" height="50" alt="Association Green IT (prononcer grine • aïe • ti)">
- …
I've updated the .htaccess on the server + updated the comment ☝️
(added: image/svg+xml
)
from ecoindex.
Related Issues (20)
- [Résultat] Afficher l'URL complète de la page analysée HOT 1
- Barème des scores/grades HOT 2
- [Évolution] Interet du nombre de requêtes avec HTTP/2 HOT 5
- [Bug]: Erreur lors du lancement d'une analyse de domaine HOT 2
- [Bug]: infos contradictoires HOT 3
- Explain how it works more precisely
- Add stale action HOT 3
- [Bug]: Affichage de nbsp sur la page des résultats
- [Bug]: Lien vers le badge HOT 8
- [Bug]: Retester renvoie vers https://www.ecoindex.frundefined/?id=11c3f6d2-978c-4355-a204-95a91afdc7f7 HOT 1
- [Bug]: Réutilisation d'un rapport HOT 3
- Améliorer affichage sur erreur 521 quand 401 ou 403 HOT 2
- [Bug]: formula differ from website? HOT 5
- Improve the ecoIndex badge integration from the results page HOT 1
- [Bug/Enhancement]: Timeout fréquent HOT 3
- [Bug]: Formula issues? HOT 5
- [Bug]: Réutilisation d'un résultat HOT 3
- [Bug]: L'url dans le footer n'ouvre pas le site de l'association HOT 1
- [Action]: Protection anti-bot Datadome HOT 3
- [Bug]: L’analyse est en cours HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ecoindex.