Jump to content

compression de themes/default/cache


Recommended Posts

bonjour à tous

 

Apres avoir fait des réglages et test ave Gmetrix, je n'arrive pas a compresser et augmenter le cache dans :

 

themes/default/cache

 

voici les résultats :

 

Enable gzip compression

Compressing the following resources with gzip could reduce their transfer size by 42.6KiB (81% reduction).

 

Compressing

  • /themes/default/cache/5d1830f3e34acae38b_all.css could save 42.6KiB (81% reduction)

Leverage browser caching

The following cacheable resources have a short freshness lifetime. Specify an expiration at least one week in the future for the following resources:

  • /themes/default/cache/ddef54ca580f7cb.js (expiration not specified)
  • Qui aurais une idée

J'ai pourtant dans ce dossier un php.ini avec gzip

Merci d'avance

Edited by jp77 (see edit history)
Link to comment
Share on other sites

bonjour Divine

 

Cela faisait longtemps que nous n'avions pas échangé ici.

 

A la racine de mon site j'ai un .htaccess comme ceci :


# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again
# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# http://www.prestashop.com - http://www.prestashop.com/forums

# KILL THEM ETAGS
Header unset ETag
FileETag none

<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>

<IfModule mod_rewrite.c>
<IfModule mod_env.c>
SetEnv HTTP_MOD_REWRITE On
</IfModule>

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.www.fr$
RewriteRule . - [E=REWRITEBASE:/]
RewriteRule ^api/?(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]

# Images
RewriteCond %{HTTP_HOST} ^www.comatic.fr$
RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L]
RewriteCond %{HTTP_HOST} ^www.comatic.fr$
RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L]
RewriteCond %{HTTP_HOST} ^www.comatic.fr$
RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L]
RewriteCond %{HTTP_HOST} ^www.comatic.fr$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L]
RewriteCond %{HTTP_HOST} ^www.comatic.fr$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L]
RewriteCond %{HTTP_HOST} ^www.comatic.fr$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L]
RewriteCond %{HTTP_HOST} ^www.comatic.fr$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L]
RewriteCond %{HTTP_HOST} ^www.comatic.fr$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L]
RewriteCond %{HTTP_HOST} ^www.comatic.fr$
RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L]
RewriteCond %{HTTP_HOST} ^www.comatic.fr$
RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L]
# AlphaImageLoader for IE and fancybox
RewriteCond %{HTTP_HOST} ^www.comatic.fr$
RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L]

# Dispatcher
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{HTTP_HOST} ^www.comatic.fr$
RewriteRule ^.*$ - [NC,L]
RewriteCond %{HTTP_HOST} ^www.comatic.fr$
RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L]
</IfModule>

<IfModule mod_expires.c>
	ExpiresActive On
	ExpiresByType image/gif "access plus 1 month"
	ExpiresByType image/jpeg "access plus 1 month"
	ExpiresByType image/png "access plus 1 month"
	ExpiresByType text/css "access plus 1 week"
	ExpiresByType text/javascript "access plus 1 week"
	ExpiresByType application/javascript "access plus 1 week"
	ExpiresByType application/x-javascript "access plus 1 week"
	ExpiresByType image/x-icon "access plus 1 year"
</IfModule>

FileETag INode MTime Size
<IfModule mod_deflate.c>
	<IfModule mod_filter.c>
		AddOutputFilterByType DEFLATE text/html text/css text/javascript application/javascript application/x-javascript
	</IfModule>
</IfModule>

#If rewrite mod isn't enabled
ErrorDocument 404 /index.php?controller=404

# ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again



et également un php.ini

<?
zlib.output_compression = true
?>

dans themes/default/cache j'ai été réussi à améliorer les performance avec un autre .htaccess qui contient ceci :

AddType x-mapp-php5 .php .php3 .php4 .htm .html .js

    <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
    Header set Cache-Control "public, max-age=290304000"
    </FilesMatch>

    <FilesMatch "\.(xml|txt)$">
    Header set Cache-Control "max-age=172800, public, must-revalidate"
    </FilesMatch>
		
 



RewriteEngine on
#Check to see if browser can accept gzip files. If so and we have it - serve it!
ReWriteCond %{HTTP:accept-encoding} gzip
RewriteCond %{HTTP_USER_AGENT} !Safari
#make sure there's no trailing .gz on the url
ReWriteCond %{REQUEST_FILENAME} !^.+\.gz$
#check to see if a .gz version of the file exists.
RewriteCond %{REQUEST_FILENAME}.gz -f
#All conditions met so add .gz to URL filename (invisibly)
RewriteRule ^(.+) $1.gz [QSA,L]
 <IfModule mod_gzip.c>
 mod_gzip_on Yes
 mod_gzip_dechunk Yes
 mod_gzip_keep_workfiles No
 mod_gzip_can_negotiate Yes
 mod_gzip_add_header_count Yes
 mod_gzip_send_vary Yes
 mod_gzip_command_version '/mod_gzip_status'
 mod_gzip_min_http 1000
 mod_gzip_minimum_file_size 300
 mod_gzip_maximum_file_size 512000
 mod_gzip_maximum_inmem_size 60000
 mod_gzip_handle_methods GET POST
 mod_gzip_temp_dir /tmp
 mod_gzip_item_include file \.html$
 mod_gzip_item_include file \.php$
 mod_gzip_item_include file \.pl$
 mod_gzip_item_include file \.rb$
 mod_gzip_item_include file \.py$
 mod_gzip_item_include file \.cgi$
 mod_gzip_item_include file \.css$
 mod_gzip_item_include file \.js$
 mod_gzip_item_include mime ^application/javascript$
 mod_gzip_item_include mime ^application/x-javascript$
 mod_gzip_item_include mime ^text/.*
 mod_gzip_item_include mime ^httpd/unix-directory$
 mod_gzip_item_include handler ^cgi-script$
 mod_gzip_item_include handler ^server-status$
 mod_gzip_item_include handler ^server-info$
 mod_gzip_item_include handler ^application/x-httpd-php
 mod_gzip_item_exclude mime ^image/.*
 </IfModule>

et un php.ini avec ceci :

<?
zlib.output_compression = true
?>

C'est bien pour ça que je ne comprends plus rien

 

Merci de ton aide

Link to comment
Share on other sites

bonjour Ludivine

 

Je n'avais pas reçu ta réponse.

 

Oui mon hebergement le supporte je suis chez 1 and 1 , et quand je mets dans le php.ini

<?
zlib.output_compression = false
?>

au lieu de

<?
zlib.output_compression = true
?>

c'est encore pire, donc sauf erreur mon hébergement prend la compression

Par contre je ne sais pas si cela à un rapport mais dans SEO & URL j'ai également URL simplifié OUI et pourtant cela indique à coté :

      Le mode de réécriture d'URL
(mod_rewrite) n'est pas activé sur votre serveur, ou il est impossible de
vérifier la configuration. Pour utiliser les URLs réécrites, vous devez activer
ce mode.

 

et voici les info phpinfo:

PHP Variables


Variable

Value

_REQUEST["__utmc"] 190865647 
_REQUEST["__utma"] 190865647.630264488.1392718562.1392718562.1392718562.1 
_REQUEST["__utmb"] 190865647.63.10.1392718562 
_REQUEST["__utmz"] 190865647.1392718562.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none) 
_COOKIE["__utmc"] 190865647 
_COOKIE["__utma"] 190865647.630264488.1392718562.1392718562.1392718562.1 
_COOKIE["__utmb"] 190865647.63.10.1392718562 
_COOKIE["__utmz"] 190865647.1392718562.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none) 
_SERVER["REDIRECT_UNIQUE_ID"] UwNJ6wouEjcAADPZmwQAAAAp 
_SERVER["REDIRECT_SCRIPT_URL"] /phpinfo.php 
_SERVER["REDIRECT_SCRIPT_URI"] http://www.xxxxxxxxxxx.xx/phpinfo.php 
_SERVER["REDIRECT_DOCUMENT_ROOT"] /kunden/homepages/xx/xxxxxxxxxxxx/htdocs 
_SERVER["REDIRECT_UI_SUEXEC_FSTATD_UNIXSOCKET"] /var/run/ui-fstatd.suexec.socket 
_SERVER["REDIRECT_HANDLER"] x-mapp-php6 
_SERVER["REDIRECT_STATUS"] 200 
_SERVER["UNIQUE_ID"] UwNJ6wouEjcAADPZmwQAAAAp 
_SERVER["DBENTRY_HOST"] xxxxxxxxxxxxxx.xx
_SERVER["DBENTRY"] /kunden/homepages/xx/xxxxxxxxxxxx/htdocs:d0000#CPU 6 #MEM 10240 #CGI 346 #NPROC 12 #TAID 60565662 #WERB 0 #LANG 2 #STAT 1 
_SERVER["SCRIPT_URL"] /phpinfo.php 
_SERVER["SCRIPT_URI"] http://www.xxxxxxxxxxx.xx/phpinfo.php 
_SERVER["HTTP_ACCEPT"] text/html, application/xhtml+xml, */* 
_SERVER["HTTP_ACCEPT_LANGUAGE"] fr-FR 
_SERVER["HTTP_USER_AGENT"] Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0) 
_SERVER["HTTP_ACCEPT_ENCODING"] gzip, deflate 
_SERVER["HTTP_HOST"] www.xxxxxxxxxxxx.xx 
_SERVER["HTTP_DNT"] 1 
_SERVER["HTTP_CONNECTION"] Keep-Alive 
_SERVER["HTTP_COOKIE"] __utmc=190865647; __utma=190865647.630264488.1392718562.1392718562.1392718562.1; __utmb=190865647.63.10.1392718562; __utmz=190865647.1392718562.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none) 
_SERVER["PATH"] /bin:/usr/bin 
_SERVER["SERVER_SIGNATURE"] no value 
_SERVER["SERVER_SOFTWARE"] Apache 
_SERVER["SERVER_NAME"] xxxxxxxxxxx
_SERVER["SERVER_ADDR"] xx.xxx.xxx.xx
_SERVER["SERVER_PORT"] 80 
_SERVER["REMOTE_ADDR"] xx.xx.xx.xxx 
_SERVER["DOCUMENT_ROOT"] /kunden/homepages/xx/xxxxxxxxxx/htdocs 
_SERVER["SERVER_ADMIN"] [email protected] 
_SERVER["SCRIPT_FILENAME"] /kunden/homepages/xx/xxxxxxxxxxxxxxx/htdocs/phpinfo.php 
_SERVER["REMOTE_PORT"] 58977 
_SERVER["REDIRECT_URL"] /phpinfo.php 
_SERVER["GATEWAY_INTERFACE"] CGI/1.1 
_SERVER["SERVER_PROTOCOL"] HTTP/1.1 
_SERVER["REQUEST_METHOD"] GET 
_SERVER["QUERY_STRING"] no value 
_SERVER["REQUEST_URI"] /phpinfo.php 
_SERVER["SCRIPT_NAME"] /phpinfo.php 
_SERVER["STATUS"] 200 
_SERVER["ORIG_PATH_INFO"] /phpinfo.php 
_SERVER["ORIG_PATH_TRANSLATED"] /kunden/homepages/xx/xxxxxxxxxxxxxxxx/htdocs/phpinfo.php 
_SERVER["PHP_SELF"] /phpinfo.php 
_SERVER["REQUEST_TIME"] 1392724459 
_SERVER["argv"] Array
(
)

 
_SERVER["argc"] 0 
_ENV["REDIRECT_UNIQUE_ID"] UwNJ6wouEjcAADPZmwQAAAAp 
_ENV["REDIRECT_SCRIPT_URL"] /phpinfo.php 
_ENV["REDIRECT_SCRIPT_URI"] http://xxxxxxxxxxxxxxx/phpinfo.php 
_ENV["REDIRECT_DOCUMENT_ROOT"] /kunden/homepages/xx/xxxxxxxxxxx/htdocs 
_ENV["REDIRECT_UI_SUEXEC_FSTATD_UNIXSOCKET"] /var/run/ui-fstatd.suexec.socket 
_ENV["REDIRECT_HANDLER"] x-mapp-php5 
_ENV["REDIRECT_STATUS"] 200 
_ENV["UNIQUE_ID"] UwNJ6wouEjcAADPZmwQAAAAp 
_ENV["DBENTRY_HOST"] xxxxxxxxxxxxxx 
_ENV["DBENTRY"] /kunden/homepages/xx/xxxxxxxxxxxxxxx/htdocs:d0000#CPU 6 #MEM 10240 #CGI 346 #NPROC 12 #TAID 60565662 #WERB 0 #LANG 2 #STAT 1 
_ENV["SCRIPT_URL"] /phpinfo.php 
_ENV["SCRIPT_URI"] http://www.xxxxxxxxxx.xx/phpinfo.php 
_ENV["HTTP_ACCEPT"] text/html, application/xhtml+xml, */* 
_ENV["HTTP_ACCEPT_LANGUAGE"] fr-FR 
_ENV["HTTP_USER_AGENT"] Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0) 
_ENV["HTTP_ACCEPT_ENCODING"] gzip, deflate 
_ENV["HTTP_HOST"] www.xxxxxxxxxxxxxxx.xx 
_ENV["HTTP_DNT"] 1 
_ENV["HTTP_CONNECTION"] Keep-Alive 
_ENV["HTTP_COOKIE"] __utmc=190865647; __utma=190865647.630264488.1392718562.1392718562.1392718562.1; __utmb=190865647.63.10.1392718562; __utmz=190865647.1392718562.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none) 
_ENV["PATH"] /bin:/usr/bin 
_ENV["SERVER_SIGNATURE"] no value 
_ENV["SERVER_SOFTWARE"] Apache 
_ENV["SERVER_NAME"] xxxxxxxxxxxxx
_ENV["SERVER_ADDR"] xx.xxx.xxx.xx 
_ENV["SERVER_PORT"] 80 
_ENV["REMOTE_ADDR"] xx.xx.xx.xxx 
_ENV["DOCUMENT_ROOT"] /kunden/homepages/xxx/xxxxxx/htdocs 
_ENV["SERVER_ADMIN"] xxxxxxxx@xxxxxxxx 
_ENV["SCRIPT_FILENAME"] /kunden/homepages/xx/xxxxxxxxxxxx/htdocs/phpinfo.php 
_ENV["REMOTE_PORT"] 58977 
_ENV["REDIRECT_URL"] /phpinfo.php 
_ENV["GATEWAY_INTERFACE"] CGI/1.1 
_ENV["SERVER_PROTOCOL"] HTTP/1.1 
_ENV["REQUEST_METHOD"] GET 
_ENV["QUERY_STRING"] no value 
_ENV["REQUEST_URI"] /phpinfo.php 
_ENV["SCRIPT_NAME"] /phpinfo.php 
_ENV["STATUS"] 200 
_ENV["ORIG_PATH_INFO"] /phpinfo.php 
_ENV["ORIG_PATH_TRANSLATED"] /kunden/homepages/xx/xxxxxxxxxxxxxxx/htdocs/phpinfo.php 

Et j'a le même problème sur un autre site en php5

 

Merci encore

 

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...