Dobrý den,
rád bych zrychlil načítání eshopu. Page Speed Insights mi říká, že je třeba opravit načítání do mezipaměti prohlížeče (
Nastavení data vypršení platnosti nebo maximálního stáří v záhlavích protokolu HTTP statických zdrojů dává prohlížeči pokyn, aby již stažené zdroje načítal z místního disku, a nikoli prostřednictvím sítě.). Předpokládám, že toto je nutné provést v .htaccess. Bude stačit v Advanced Parameters > Performance zakliknout u Optimalizace Apache na ANO?
Na fóru prestashopu jsem našel tento kód ([url]https://www.prestashop.com/forums/topic/322583-tipy-pro-zrychlení-načítání-stránek/?p=1632522[/url]):
Kód:
# BEGIN Compress text files
<ifModule mod_deflate.c>
AddOutputFilterByType DEFLATE \
text/html \
text/xml \
text/css \
text/plain \
image/svg+xml \
application/xhtml+xml \
application/xml \
application/rdf+xml \
application/rss+xml \
application/atom+xml \
text/javascript \
text/ecmascript \
application/javascript \
application/x-javascript \
application/ecmascript \
application/json \
application/x-font-ttf \
application/x-font-otf \
font/truetype \
font/opentype \
application/x-pointplus
</ifModule>
# END Compress text files
# BEGIN Expire headers
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 2592000 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/jpg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 604800 seconds"
ExpiresByType application/javascript "access plus 604800 seconds"
ExpiresByType application/x-javascript "access plus 604800 seconds"
ExpiresByType text/html "access plus 604800 seconds"
ExpiresByType application/xhtml+xml "access plus 604800 seconds"
</ifModule>
# END Expire headers
# BEGIN Cache-Control Headers
<ifModule mod_headers.c>
<filesMatch "\.(ico|jpe?g|png|gif|swf)$">
Header set Cache-Control "public"
</filesMatch>
<filesMatch "\.(css)$">
Header set Cache-Control "public"
</filesMatch>
<filesMatch "\.(js)$">
Header set Cache-Control "private"
</filesMatch>
<filesMatch "\.(x?html?|php)$">
Header set Cache-Control "private, max-age=360, must-revalidate"
</filesMatch>
</ifModule>
# END Cache-Control Headers
, který je třeba umístit nad
Kód:
# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again
Úpravám .htaccess souboru moc nerozumím, proto budu rád za každou radu. Předem díky