質問: qnapでsquid(facebook、ビデオ、ダウンロード、.exe)を使用してすべてのデータをキャッシュする方法 qnapのsquidサーバーにfacebook、すべてのビデオ、ダウンロード、写真、およびwebページをキャッシュするのを手伝ってくれる人はいますか?以下は私の設定です。キャッシュに4 gbを使用したい。私はすべてを試しましたが、正しく機能していません。# the user name and group name squid will operate as cache_effective_user httpdusr cache_effective_group everyone # # recommended minimum configuration: # # auth method #auth_param basic program /share/md0_data/.qpkg/squid/opt/libexec/squid/ncsa_auth /etc/shadow #auth_param basic children 5 #auth_param basic realm squid proxy-caching web server #auth_param basic credentialsttl 2 hours acl manager proto cache_object acl localhost src 127.0.0.1/32 ::1 acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1 # example rule allowing access from your local networks. # adapt to list your (internal) ip networks from where browsing # should be allowed acl localnet src 10.0.0.0/8 # rfc1918 possible internal network acl localnet src 172.16.0.0/12 # rfc1918 possible internal network acl localnet src 192.168.0.0/16 # rfc1918 possible internal network acl localnet src fc00::/7 # rfc 4193 local private network range acl localnet src fe80::/10 # rfc 4291 link-local (directly plugged) machines acl ssl_ports port 443 acl safe_ports port 80 # http acl safe_ports port 21 # ftp acl safe_ports port 443 # https acl safe_ports port 70 # gopher acl safe_ports port 210 # wais acl safe_ports port 1025-65535 # unregistered ports acl safe_ports port 280 # http-mgmt acl safe_ports port 488 # gss-http acl safe_ports port 591 # filemaker acl safe_ports port 777 # multiling http acl connect method connect #acl ncsa_users proxy_auth required # # recommended minimum access permission configuration: # # only allow cachemgr access from localhost http_access allow manager localhost http_access deny manager # deny requests to certain unsafe ports http_access deny !safe_ports # deny connect to other than secure ssl ports http_access deny connect !ssl_ports # we strongly recommend the following be uncommented to protect innocent # web applications running on the proxy server who think the only # one who can access services on "localhost" is a local user #http_access deny to_localhost # # insert your own rule(s) here to allow access from your clients # # example rule allowing access from your local networks. # adapt localnet in the acl section to list your (internal) ip networks # from where browsing should be allowed http_access allow localnet #http_access allow ncsa_users # and finally deny all other access to this proxy http_access deny all # squid normally listens to port 3128 http_port 3128 # we recommend you to use at least the following line. hierarchy_stoplist cgi-bin ? # uncomment and adjust the following to add a disk cache directory. #cache_dir ufs /share/md0_data/.qpkg/squid/opt/var/squid/cache 100 16 256 cache_mem 8 mb minimum_object_size 0 bytes maximum_object_size 200 mb maximum_object_size_in_memory 512 kb # leave coredumps in the first cache dir coredump_dir /share/md0_data/.qpkg/squid/opt/var/squid/ access_log /share/md0_data/.qpkg/squid/opt/var/squid/logs/access.log squid cache_log /share/md0_data/.qpkg/squid/opt/var/squid/logs/cache.log cache_store_log /share/md0_data/.qpkg/squid/opt/var/squid/logs/store.log # add logfile rotated mechanism logfile_rotate 7 debug_options rotate=1 # mime_table /share/md0_data/.qpkg/squid/opt/etc/squid/mime.conf pid_filename /share/md0_data/.qpkg/squid/opt/var/squid/run/squid.pid diskd_program /share/md0_data/.qpkg/squid/opt/libexec/squid/diskd unlinkd_program /share/md0_data/.qpkg/squid/opt/libexec/squid/unlinkd icon_directory /share/md0_data/.qpkg/squid/opt/share/squid/icons err_page_stylesheet /share/md0_data/.qpkg/squid/opt/etc/squid/errorpage.css error_default_language en-us error_directory /share/md0_data/.qpkg/squid/opt/share/squid/errors/en-us # add any of your own refresh_pattern entries above these. # video cache refresh_pattern ^http://(.*?)/get_video\? 10080 90% 432000 override-expire ignore-no-cache ignore-private refresh_pattern ^http://(.*?)/videoplayback\? 10080 90% 432000 override-expire ignore-no-cache ignore-private refresh_pattern -i (get_video\?|videoplayback\?id|videoplayback.*id) 161280 50000% 525948 override-expire ignore-reload # facebook refresh_pattern ((facebook.com)|(85.131.151.39)).*\.(jpg|png|gif) 129600 999999% 129600 ignore-reload override-expire ignore-no-cache ignore-no-store store-stale refresh_pattern ((tagged.com)|(96.17.109.27)).*\.(jpg|png|gif) 129600 999999% 129600 ignore-reload override-expire ignore-no-cache ignore-no-store store-stale refresh_pattern static\.ak\.fbcdn\.net*\.(jpg|gif|png) 129600 999999% 129600 ignore-reload override-expire ignore-no-cache ignore-no-store store-stale refresh_pattern ^http:\/\/profile\.ak\.fbcdn.net*\.(jpg|gif|png) 129600 999999% 129600 ignore-reload override-expire ignore-no-cache ignore-no-store store-stale refresh_pattern edgecastcdn.\net.*\.swf? 129600 999999% 129600 override-expire ignore-reload store-stale refresh_pattern \.(jp(e?g|e|2)|tiff?|bmp|gif|png)($|&) 129600 999999% 129600 ignore-no-cache ignore-no-store reload-into-ims override-expire store-stale refresh_pattern .zynga.net.*\.(jpg|gif|png|swf|mp3)($|&) 129600 999999% 129600 store-stale refresh_pattern .zynga.com.*\.(jpg|gif|png|swf|mp3)($|&) 129600 999999% 129600 store-stale refresh_pattern .farmville.net.*\.(jpg|gif|png|swf|mp3)($|&) 129600 999999% 129600 store-stale refresh_pattern .farmville.com.*\.(jpg|gif|png|swf|mp3)($|&) 129600 999999% 129600 store-stale refresh_pattern .ninjasaga.com.*\.(jpg|gif|png|swf|mp3)($|&) 129600 999999% 129600 store-stale refresh_pattern .apps.facebook.com.*\.(jpg|gif|png|swf|mp3)($|&) 129600 999999% 129600 store-stale refresh_pattern .frontierville.*\.(jpg|gif|png|swf|mp3)($|&) 129600 999999% 129600 store-stale refresh_pattern .tagged.*\.(jpg|gif|png|swf|mp3)($|&) 129600 999999% 129600 store-stale #ads refresh_pattern ^.*(utm\.gif|ads\?|rmxads\.com|ad\.z5x\.net|bh\.contextweb\.com|bstats\.adbrite\.com|a1\.interclick\.com|ad\.trafficmp\.com|ads\.cubics\.com|ad\.xtendmedia\.com|\.googlesyndication\.com|advertising\.com|yieldmanager|game-advertising\.com|pixel\.quantserve\.com|adperium\.com|doubleclick\.net|adserving\.cpxinteractive\.com|syndication\.com|media.fastclick.net).* 129600 20% 129600 ignore-no-cache ignore-no-store ignore-private override-expire ignore-reload ignore-auth store-stale negative-ttl=40320 max-stale=1440 #specific sites refresh_pattern ^.*safebrowsing.*google 129600 999999% 129600 override-expire ignore-reload ignore-no-cache ignore-no-store ignore-private ignore-auth negative-ttl=10080 store-stale refresh_pattern (get_video\?|videoplayback\?|videodownload\?|\.flv?) 129600 99999999% 129600 override-expire ignore-reload store-stale refresh_pattern \.(ico|video-stats) 129600 999999% 129600 override-expire ignore-reload ignore-no-cache ignore-no-store ignore-private ignore-auth override-lastmod negative-ttl=10080 store-stale # pictures & images refresh_pattern -i \.(gif|png|jpeg|jpg|bmp|tif|tiff|ico)$ 10080 50% 43200 override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache ignore-auth ignore-private store-stale refresh_pattern -i \.(gif|png|jpeg|jpg|bmp|tif|tiff|ico)\? 10080 50% 43200 override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache ignore-auth ignore-private store-stale # website #refresh_pattern -i \.(xml|html|htm|js|jsp|txt|css|php|asp)$ 10080 50% 43200 override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache ignore-auth store-stale refresh_pattern -i \.(xml|js|jsp|txt|css)$ 10080 50% 43200 override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache ignore-auth store-stale refresh_pattern -i \.(xml|js|jsp|txt|css)\? 10080 50% 43200 override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache ignore-auth store-stale #sound, video multimedia refresh_pattern -i \.(flv|x-flv|mov|avi|qt|mpg|mpeg|swf|wmv)$ 10080 50% 43200 override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache store-stale refresh_pattern -i \.(wav|mp3|mp4|au|mid)$ 10080 50% 43200 override-expire override-lastmod reload-into-ims ignore-reload ignore-no-cache ignore-auth ignore-private store-stale # files refresh_pattern -i \.(iso|deb|rpm|zip|tar|tgz|ram|rar|bin|ppt|doc)$ 10080 90% 43200 ignore-no-cache ignore-auth store-stale refresh_pattern -i \.(zip|gz|arj|lha|lzh)$ 10080 100% 43200 override-expire ignore-no-cache ignore-auth store-stale refresh_pattern -i \.(rar|tgz|tar|exe|bin)$ 10080 100% 43200 override-expire ignore-no-cache ignore-auth ignore-reload ignore-no-cache store-stale refresh_pattern -i \.(hqx|pdf|rtf|doc|swf)$ 10080 100% 43200 override-expire ignore-no-cache ignore-auth store-stale refresh_pattern -i \.(inc|cab|ad|txt|dll)$ 10080 100% 43200 override-expire ignore-no-cache ignore-auth store-stale #iix download refresh_pattern ^http:\/\/\.www[0-9][0-9]\.indowebster\.com\/(.*)(mp3|rar|zip|flv|wmv|3gp|mp(4|3)|exe|msi|zip) 43200 99999% 129600 reload-into-ims ignore-reload override-expire ignore-no-cache ignore-no-store store-stale ignore-auth #default option refresh_pattern ^ftp: 1440 20% 10080 refresh_pattern -i (/cgi-bin/|\?) 1 0% 2 refresh_pattern ^gopher: 1440 0% 1440 refresh_pattern . 0 20% 4320 store-stale
回答: try this# uncomment and adjust the following to add a disk cache directory. #cache_dir ufs /share/md0_data/.qpkg/squid/opt/var/squid/cache 100 16 256 cache_mem 8 mb minimum_object_size 0 bytes maximum_object_size 200 mb maximum_object_size_in_memory 512 kb なるcache_dir ufs /share/md0_data/.qpkg/squid/opt/var/squid/cache 4000 16 256 cache_mem 8 mb minimum_object_size 0 bytes maximum_object_size 200 mb maximum_object_size_in_memory 512 kb それが役に立てば幸い:)