Pусский
English

FAQ. Продукты и решения Blue Coat » ПРОДУКТЫ » --- CacheFlow

« Назад

Последние политики кеширования для Youtube и Google Video (июнь 2011) для ProxySG.  03.10.2011

Ниже приведены последние политики кеширования для YouTube и Google Video, взятые с  Cachepulse системы CacheFlow. Они проверены и успешно работают для Flash и HTML5 (на YouTube).

<Proxy "YouTube specific caching rewrite"> condition=youtube_related_request

  condition=youtube_seek_video_requests ; leave seek requests alone, not caching

  condition=youtube_video_request_style1 url.query.regex="itag=34" action.rename_youtubeSD(yes)

  condition=youtube_video_request_style2 url.query.regex="itag=34" action.rename_youtube_style2SD(yes)

  condition=youtube_video_request_style1 action.rename_youtube(yes)

  condition=youtube_video_request_style2 action.rename_youtube_style2(yes)

  condition=youtube_host_patterns condition=youtube_video_requests action.rename_youtube_url_hostname(yes)

<Cache "video content">

   ; YOUTUBE & GOOGLEVIDEO - 10 days

 [rule]

    condition=youtube_seek_video_requests cache(no)

    condition=youtube_video_requests ttl(864000) force_cache(all)

; YOUTUBE DEFINITIONS

;

define condition youtube_related_request

  request.header.Referer.exists=yes condition=youtube_referer_present

  condition=youtube_host_patterns

end

define condition youtube_host_patterns

  url.host.substring="youtube"

  url.host.substring="googlevideo"

  url.host.is_numeric=yes url.address=youtube_subnets

end

define subnet youtube_subnets

      ;; these can be fairly broadly drawn, since appearance in here

      ;; alone does not itself force youtubeization; the request also

      ;; has to be relatively youtube specific.

      ;; IE this is an optimization, not a pure correctness filter

  ; observed in eval logs Mar2010

  74.125.0.0/16    ; GOOGLE NET-74-125-0-0-1

  173.194.0.0/16   ; GOOGLE NET-173-194-0-0-1

  ;204.246.234.23/24 ; used by cache but assigned to frontiernet.net

  ;youtube_ARIN_IPs

  ;IPv4 CIDR:

  208.65.152.0/22  ; YOUTUBE

  64.15.112.0/20   ; YOUTUBE2

  208.117.224.0/19 ; YOUTUBE3

  72.51.34.221/32

  72.51.34.222/31

  72.51.34.224/29

  72.51.34.232/30

  72.51.34.236/32

  72.51.35.205/32

  72.51.35.206/31

  72.51.35.208/30

  72.51.35.212/32

  ; 75.35.233.64/29   ; now sbcglobal

  ; 75.31.180.240/29  ; now sbcglobal

  76.210.160.216/29

  76.208.211.160/29

  ; 75.48.116.72/29   ; now sbcglobal

  75.55.218.8/29

  ;IPv6 CIDR:

  ;2620:0000:0040:0000:0000:0000:0000:0000/48

  ;

  ;youtube_RIPE_IPs

  ;IPv4 CIDR:

  194.221.68.0/24

  195.27.182.0/24

  195.59.171.0/24

  213.146.171.0/24

  82.129.37.0/24     ; YOUTUBE-EUROPE

  89.207.225.0/24

  209.85.128.0/17    ; Seen at Mobily

end

define condition youtube_referer_present

  request.header.Referer.url.substring="ytimg"

  request.header.Referer.url.substring="youtube"

  request.header.Referer.url.substring="video.google.com"

end

define condition youtube_video_request_style1

  url.path.exact="/get_video" url.query.regex="video_id="

end

define condition youtube_video_request_style2

  url.path.exact="/videoplayback" url.query.regex="id="

end

define condition youtube_video_requests

  condition=youtube_video_request_style1

  condition=youtube_video_request_style2

end

define condition youtube_seek_video_requests

    url.path.exact=/videoplayback url.query.regex="begin=[1-9]"

    url.path.exact=/get_video url.query.regex="begin=[1-9]"

end

define action rename_youtube

  ;--NOTE the following is one line (approximately 120 characters long)

  rewrite(url, "(.+)video_id=([^&]+)(\&.*|$)", "http://youtube.proxysg-cache/get_video/$(2)", cache)

end

define action rename_youtube_style2

  ;--NOTE the following is one line (approximately 120 characters long)

  rewrite(url, "(.+)id=([^&]+)(\&.*|$)", "http://youtube.proxysg-cache/get_video_style2/$(2)", cache)

end

define action rename_youtubeSD

  ;--NOTE the following is one line (approximately 120 characters long)

  rewrite(url, "(.+)video_id=([^&]+)(\&.*|$)", "http://youtube.proxysg-cache/get_video/$(2)_SD", cache)

end

define action rename_youtube_style2SD

  ;--NOTE the following is one line (approximately 120 characters long)

  rewrite(url, "(.+)id=([^&]+)(\&.*|$)", "http://youtube.proxysg-cache/get_video_style2/$(2)_SD", cache)

end

define action rename_youtube_url_hostname

  rewrite(url.host, ".*", "youtube.proxysg-cache", cache)

end



Разделы статей

Компания Web Control. Тел./факс: +7 (495) 925-7794
email: info@web-control.ru, 107023, г. Москва, Электрозаводская ул., д. 24
Яндекс.Метрика