Author Topic: What are policy labels for?  (Read 1868 times)

Offline evildani

  • Administrator
  • Hero Member
  • *****
  • Posts: 373
  • Karma: 22
What are policy labels for?
« on: March 31, 2008, 02:11:47 PM »
I was trying to set up a Cache Selector as Oracle sugested in another thread.
I was setting up some rewrite rules and actions, and since many were bound to the same vserver I decided to group them all under one policy label, I did, but I could not bound the policy label, and if I bind the individual policy is throws an error stating that "can only be bound once". I was like WTF, whats the use for a policy label, it is a clear way to group together policies, but I could not find a way to bind the policy label. So am I missing something here?
Now that I am asking a question, heres another one: what's the use for Pattern Class in the rewrite module NS8.0?

Later,

Daniel

BTW Oracle, the cache selector is great and very poorly documented.

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 152
  • Karma: 18
Re: What are policy labels for?
« Reply #1 on: March 31, 2008, 04:36:23 PM »
First example... patClass:

add policy patClass spiders
bind policy patClass spiders Yahoo
bind policy patClass spiders csspider
bind policy patClass spiders 365bloglink
bind policy patClass spiders soso
bind policy patClass spiders bloglines
add cs policy spider -rule "http.REQ.HEADER(\"User-Agent\").CONTAINS_ANY(\"spiders\")"

Policy labels are as you suggest used to group policies together.  You bind a policy label not by naming it as a policy, but as a target of a policy, so for example:


add rewrite action rm_svr_hdr delete_http_header Server
add rewrite action rm_vary_hdr delete_http_header Vary
add rewrite action rm_cont_loc_hdr delete_http_header "Content-Location"
add rewrite action rm_via_hdr delete_http_header Via
add rewrite action rm_cc_header delete_http_header "Cache-Control"
add rewrite action rm_etag_header delete_http_header Etag

add rewrite policy jumpto_cleanup true NOREWRITE
add rewrite policy rm_server_hdr true rm_svr_hdr
add rewrite policy rm_etag_header "http.REQ.HEADER(\"Last-Modified\").EXISTS" rm_etag_header
add rewrite policy rm_cc_header "http.REQ.HEADER(\"Last-Modified\").EXISTS" rm_cc_header
add rewrite policy rm_via_header true rm_via_hdr
add rewrite policy rm_cont_loc_header true rm_cont_loc_hdr
add rewrite policy rm_vary_header true rm_vary_hdr

add rewrite policylabel "response-cleanup" http_res
bind rewrite policylabel "response-cleanup" rm_server_hdr 10 NEXT
bind rewrite policylabel "response-cleanup" rm_etag_header 20 NEXT
bind rewrite policylabel "response-cleanup" rm_cc_header 30 NEXT
bind rewrite policylabel "response-cleanup" rm_via_header 40 NEXT
bind rewrite policylabel "response-cleanup" rm_cont_loc_header 50 NEXT
bind rewrite policylabel "response-cleanup" rm_vary_header 60 NEXT
bind rewrite global jumpto_cleanup 10 NEXT -type RES_DEFAULT -invoke policylabel "response-cleanup"

The Oracle

Offline evildani

  • Administrator
  • Hero Member
  • *****
  • Posts: 373
  • Karma: 22
Re: What are policy labels for?
« Reply #2 on: April 02, 2008, 09:51:16 AM »
It works great, I did all my policies for Oracle Portal under one policy label and applied them globally for all my oracle portal sites. And used the cache selectors for all the portal pages, and it works great, Thanks a lot.
Daniel