Guest User

fuf-hash.vcl

a guest
Jul 25th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. sub vcl_hash {
  2. hash_data(req.url);
  3. // Summarize images01, images02 ...
  4. if (req.http.host) {
  5. hash_data(regsub(req.http.host, "^images\d\d\.", "images"));
  6. } else {
  7. hash_data(server.ip);
  8. }
  9. // Separate cache for ajax requests
  10. if (req.http.X-Requested-With) {
  11. hash_data(req.http.X-Requested-With);
  12. }
  13. // Per-user frontend caching (do not make separate copies of css/js)
  14. if (req.http.host && req.http.host ~ "^(www\.)?oursite\.(at|com)" && req.url !~ "^/(css|js|images|fonts)/") {
  15. if (req.http.Cookie ~ "SESSID") {
  16. hash_data(regsub(req.http.Cookie, "^.*?SESSID=([^;]*).*$", "\1"));
  17. }
  18. }
  19. return (lookup);
  20. }
Add Comment
Please, Sign In to add comment