NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

include "devicedetect.vcl";

// Defining our backends
backend default {
.host = "185.56.146.6";
.port = "8080";
.probe = {
.interval = 5s;
.timeout = 3 s;
.window = 5;
.threshold = 5;
}
.connect_timeout = 5s;
.first_byte_timeout = 10s;
.between_bytes_timeout = 5s;
}

// End points for purge requests
acl purge {
"localhost";
"127.0.0.1";
"185.56.146.6";
}

sub vcl_recv {
call devicedetect;

set req.http.X-Forwarded-For = client.ip; // Set the client IP
# Allow the backend to serve up stale content if it is responding slowly.
set req.grace = 30m;

// redirects for subdomain, add www
if (!(req.http.host ~ "^www.rollingstoned.nl")) {
error 750;
}

if (req.request != "GET" &&
req.request != "HEAD" &&
req.request != "PUT" &&
req.request != "POST" &&
req.request != "TRACE" &&
req.request != "PURGE" &&
req.request != "OPTIONS" &&
req.request != "DELETE") {
/* Non-RFC2616 or CONNECT which is weird. */
return (pipe);
}

// Purge WordPress requests for purge
if (req.request == "PURGE") {
if (!client.ip ~ purge) {
error 405 "Not allowed.";
}
return(lookup);
}

# Set cache for only 2 user-agent (modify for use with mobiles)
if (req.http.user-agent ~ "MSIE") {
set req.http.X-UA = "MSIE";
} else {
set req.http.X-UA = "Mozilla";
}
// Cache static objects such as images
if (req.url ~ ".(png|gif|jpeg|jpg|ico|swf|woff|otf|ttf|eot|svg|svgz|css|js|html|htm|gz|tgz|zip)(?.*|)$")
{
unset req.http.Cookie;
}

# Handle compression correctly. Different browsers send different
# "Accept-Encoding" headers, even though they mostly all support the same
# compression mechanisms. By consolidating these compression headers into
# a consistent format, we can reduce the size of the cache and get more hits.=
# @see: http:// varnish.projects.linpro.no/wiki/FAQ/Compression
if (req.http.Accept-Encoding) {
if (req.http.Accept-Encoding ~ "gzip") {
# If the browser supports it, we'll use gzip.
set req.http.Accept-Encoding = "gzip";
}
else if (req.http.Accept-Encoding ~ "deflate") {
# Next, try deflate if it is supported.
set req.http.Accept-Encoding = "deflate";
}
else {
# Unknown algorithm. Remove it and send unencoded.
unset req.http.Accept-Encoding;
}
}

if (req.request != "GET" && req.request != "HEAD") {
# /* We only deal with GET and HEAD by default */
return (pass);
}

if (req.http.user-agent ~ "facebookexternalhit")
{
return(pass);
}

# admin users always miss the cache
if( req.url ~ "^/wp-(login|admin)" || req.http.Cookie ~ "wordpress_logged_in_" ){
return (pass);
}

# Remove cookies set by Google Analytics (pattern: '__utmABC')
if (req.http.Cookie) {
set req.http.Cookie = regsuball(req.http.Cookie, "(^|; ) *__utm.=[^;]+;? *", "1");
if (req.http.Cookie == "") {
unset req.http.Cookie;
}
}

# admin users, facebook logged in users, XenForo users and comment authors always miss the cache
if( req.http.Cookie ~ "xf_session_admin" || req.http.Cookie ~ "xf_session" || req.http.Cookie ~ "wordpress_logged_in_" || req.http.Cookie ~ "fbsr_537171586310880" || req.http.Cookie ~ "wp-postpass" || req.http.Cookie ~ "comment_author_"
){
return (pass);
}

# always pass through POST requests and those with basic auth
if (req.http.Authorization || req.request == "POST") {
return (pass);
}
if(req.http.X-Requested-With == "XMLHttpRequest" || req.url ~ "nocache" || req.url ~
"(control.php|wp-comments-post.php|wp-login.php|register.php|admin.php)") {
return (pass);
}

# Do not cache these paths
if (req.url ~ "^/wp-cron.php$" ||
req.url ~ "^/xmlrpc.php$" ||
req.url ~ "^/wp-admin/.*$" ||
req.url ~ "^/wp-includes/.*$" ||
req.url ~ ".*facebook.*" ||
req.url ~ ".*fblink.*" ||
req.url ~ "^/wp-content/plugins/adrotate-pro/.*$" ||
req.url ~ "?s=")
{
return (pass);
}
# By ignoring any other cookies, it is now ok to get a page
unset req.http.Cookie;
return (lookup);
}

sub vcl_fetch {

# Vary by X-UA, so varnish will keep distinct object copies by X-UA value
set beresp.http.Vary = "X-UA";

# remove some headers we never want to see
unset beresp.http.Server;
unset beresp.http.X-Powered-By;

# only allow cookies to be set if we're in admin area
if( beresp.http.Set-Cookie && req.url !~ "^/wp-(login|admin)" ){
unset beresp.http.Set-Cookie;
}


# If WordPress or Facebook OAuth cookies found then page is not cacheable
if (req.http.Cookie ~"(wp-postpass|wordpress_logged_in|xf_session_admin|xf_session|comment_author_|fbsr_537171586310880)") {
#beresp.ttl>0 is cacheable so 0 will not be cached
set beresp.ttl = 0s;
} else {
# set beresp.cacheable = true;
set beresp.ttl=24h;#cache for 24hrs
}


# don't cache response to posted requests or those with basic auth
if ( req.request == "POST" || req.http.Authorization ) {
return (hit_for_pass);
}

# don't cache search results
if( req.url ~ "?s=" ){
return (hit_for_pass);
}

# only cache status ok
if ( beresp.status != 200 ) {
return (hit_for_pass);
}
# don't cache search results or XML RPC
if (req.url ~ "?s=" ||
req.url ~ "?P3_NOCACHE" ||
req.url ~ "xmlrpc.php" ||
req.url ~ "^/wp-content/.*$" ||

req.url ~ "admin-ajax.php" ) {
return (hit_for_pass);
}

# If our backend returns 5xx status this will reset the grace time
# set in vcl_recv so that cached content will be served and
# the unhealthy backend will not be hammered by requests
if (beresp.status == 500) {
set beresp.grace = 60s;
return (restart);
}

# GZip the cached content if possible
if (beresp.http.content-type ~ "text") {
set beresp.do_gzip = true;
}

if (req.http.X-UA-Device) {
if (!beresp.http.Vary) { # no Vary at all
set beresp.http.Vary = "X-UA-Device";
} elseif (beresp.http.Vary !~ "X-UA-Device") { # add to existing Vary
set beresp.http.Vary = beresp.http.Vary + ", X-UA-Device";
}
}
# comment this out if you don't want the client to know your
# classification
set beresp.http.X-UA-Device = req.http.X-UA-Device;

# if nothing abovce matched it is now ok to cache the response
set beresp.ttl = 1h;
return (deliver);
}
sub vcl_deliver {
# multi-server webfarm? set a variable here so you can check
# the headers to see which frontend served the request
# set resp.http.X-Server = "server-01";
if (obj.hits > 0) {
set resp.http.X-Cache = "HIT";
} else {
set resp.http.X-Cache = "MISS";
}
unset resp.http.Via;
unset resp.http.X-Varnish;
}

sub vcl_hit {
if (req.request == "PURGE") {
set obj.ttl = 0s;
error 200 "OK";
}
}

sub vcl_miss {
if (req.request == "PURGE") {
error 404 "Not cached";
}
}

sub vcl_error {
if (obj.status == 750) {
set obj.http.location = "http://www.rollingstoned.nl"+req.url;
set obj.status = 301;
return(deliver);
}
}

sub vcl_deliver {
if ((req.http.X-UA-Device) && (resp.http.Vary)) {
set resp.http.Vary = regsub(resp.http.Vary, "X-UA-Device", "User-Agent");
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.