Le 10/09/2010 12:36, DjinnS a écrit :
Le 10/09/2010 12:18, Greg a écrit :
Le 10/09/2010 11:45, DjinnS a écrit :
Salut,
J'ai un souci avec la cache d'un fichier json dans Squid.
Quelqu'un aurait une idée ?
Bonjour,
ça peut venir de tas de choses, est-ce que tu peux nous envoyer le
squid.conf complet, est-ce qu'on peut avoir accès à l'url du json ?
Comme ça, je dirais un problème d'ACL ...
Salut,
La conf de Squid. J'ai du "anonymiser" quelques parties, désolé, je
suis parano. Toutefois ces parties ne sont pas la source du problème.
Au niveau des ACL, il y a un mic-mac que vous trouverez bizarre mais
c'est qu'en fonction du domaine, le backend n'est pas le même. Ca
fonctionne très bien et c'est prévu pour de toute façon :)
### ACLs
acl all src all
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl xXxXxXx src xXxXxXx
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 81 # http bis
acl Safe_ports port 82 # http bis
acl CONNECT method CONNECT
acl xXxXxXx dstdomain xXxXxXx
acl xXxXxXx dstdomain xXxXxXx
acl xXxXxXx dstdomain xXxXxXx
acl xXxXxXx dstdomain xXxXxXx
acl xXxXxXx dstdomain xXxXxXx
acl xXxXxXx dstdomain xXxXxXx
acl xXxXxXx dstdomain xXxXxXx
acl xXxXxXx dstdomain xXxXxXx
# exclude from cache
acl excludeURL url_regex \/imgs\/newsletter\/
acl excludeURL url_regex \/sitemap_news\.xml$
acl excludeURL url_regex \/membre\/
# - PURGE
acl PURGE method PURGE
http_access allow PURGE localhost
http_access deny PURGE
http_access allow manager xXxXxXx
http_access allow manager localhost
http_access deny manager
http_access deny SSL_ports
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access allow all
icp_access deny all
htcp_access deny all
### MODE
http_port 80 accel vhost
### peers
cache_peer xXxXxXx parent 80 0 no-query originserver weight=1
name=xXxXxXx login=PASS
cache_peer xXxXxXx parent 80 0 round-robin no-query originserver
weight=1 name=xXxXxXx login=PASS
cache_peer xXxXxXx parent 80 0 round-robin no-query originserver
weight=1 name=xXxXxXx login=PASS
no_cache deny excludeURL
cache_peer_access xXxXxXx allow xXxXxXx
cache_peer_access xXxXxXx allow xXxXxXx
cache_peer_access xXxXxXx allow xXxXxXx
cache_peer_access xXxXxXx allow xXxXxXx
cache_peer_access xXxXxXx allow xXxXxXx
### cache
cache_mem 10240 MB
cache_dir aufs xXxXxXx 40960 16 256
### object size in cache
maximum_object_size_in_memory 4096 KB
minimum_object_size 0 KB
maximum_object_size 32800 KB
minimum_expiry_time 30 seconds
### cache replacement policy
cache_replacement_policy heap LFUDA
memory_replacement_policy heap LFUDA
### ip cache size
ipcache_size 32768
ipcache_low 90
ipcache_high 95
### fqdn cache size
fqdncache_size 32768
### LOGGIN
logformat squid %ts.%03tu %6tr %>a %Ss/%03Hs %<st %rm %ru %un %Sh/%<A %mt
logformat combined %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %<st
"%{Referer}>h" "%{User-Agent}>h" %Ss:%Sh
access_log none
cache_store_log none
### HEADERS
via off
httpd_suppress_version_string on
visible_hostname cache-01
request_header_max_size 64 KB
reply_header_max_size 64 KB
# MANAGER
cachemgr_passwd xxxxxxxxxxxxxxxxxxxxxxxx all
### DIVERS
hierarchy_stoplist cgi-bin ?
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern (cgi-bin|\?) 0 0% 0
# oxalide - cache static
refresh_pattern -i \.gif$ 240 20% 240
refresh_pattern -i \.png$ 240 20% 240
refresh_pattern -i \.jpg$ 240 20% 240
refresh_pattern -i \.jpeg$ 240 20% 240
refresh_pattern -i \.ico$ 240 20% 240
refresh_pattern -i \.js$ 240 20% 240
refresh_pattern -i \.swf$ 240 20% 240
refresh_pattern -i \.xml$ 240 20% 240
refresh_pattern -i \.css$ 240 20% 240
refresh_pattern . 0 20% 4320
# ne pas cacher les erreurs
negative_ttl 0 seconds
icp_port 3130
forwarded_for off
coredump_dir /var/spool/squid
shutdown_lifetime 2 seconds
pipeline_prefetch on
Vous remarquerez aussi que j'utilise alégréement le refresh_pattern
car il y a un serveur backend qui n'est pas capable d'envoyer des
headers Cache-Control (je ne le citerais pas mais certains
comprendront ...). Alors on cache de cette façon. La encore, c'est
prévu pour.
Donc ce que je ne comprends pas, c'est pourquoi malgré le header
Cache-Control, Squid ne veut pas cacher mon fichier.
Thx d'avance.
--
DjinnS
_______________________________________________
Liste de diffusion du FRsAG
http://www.frsag.org/
Ok alors pour info, c'était un problème d'horloge.
Avec un max_age tout petit, mon objet était toujours en STALE.
Apres avoir fixé l'heure du serveur ... tout fonctionne correctement.
--
DjinnS
_______________________________________________
Liste de diffusion du FRsAG
http://www.frsag.org/