{"id":429,"date":"2016-02-09T09:09:29","date_gmt":"2016-02-09T09:09:29","guid":{"rendered":"http:\/\/www.haxed.me.uk\/?p=429"},"modified":"2016-03-10T22:23:53","modified_gmt":"2016-03-10T22:23:53","slug":"testing-cdn-consistency-with-bash-time-curl-while-loop","status":"publish","type":"post","link":"https:\/\/haxed.me.uk\/index.php\/2016\/02\/09\/testing-cdn-consistency-with-bash-time-curl-while-loop\/","title":{"rendered":"Testing CDN Consistency with bash date time curl while loop"},"content":{"rendered":"<p>This is a simple one. Soa  customer was complaining that after 3 minutes the cache time of the file on his CDN was changing. I wanted to built a way to test the consistency of the requests. Here is how I did it.<\/p>\n<p>file curl-format.txt<\/p>\n<pre>\r\n     timenamelookup:  %{time_namelookup}\\n\r\n       time_connect:  %{time_connect}\\n\r\n    time_appconnect:  %{time_appconnect}\\n\r\n   time_pretransfer:  %{time_pretransfer}\\n\r\n      time_redirect:  %{time_redirect}\\n\r\n time_starttransfer:  %{time_starttransfer}\\n\r\n                    ----------\\n\r\n         time_total:  %{time_total}\\n\r\n<\/pre>\n<p>Short, simple, and to the point;<\/p>\n<pre>\r\nwhile ((1!=0)); do date; curl -w \"@curl-format.txt\" -o \/dev\/null -s \"https:\/\/www.somecdndomain.secure.raxcdn.com\/img\/upload\/3someimage_t32337827238.jpg\"; done;\r\n<\/pre>\n<p>Output looks like:<\/p>\n<pre>\r\n                    ----------\r\n         time_total:  0.395\r\nTue Feb  9 09:03:28 UTC 2016\r\n      time_namelookup:  0.151\r\n       time_connect:  0.154\r\n    time_appconnect:  0.332\r\n   time_pretransfer:  0.333\r\n      time_redirect:  0.000\r\n time_starttransfer:  0.338\r\n                    ----------\r\n         time_total:  0.351\r\nTue Feb  9 09:03:28 UTC 2016\r\n      time_namelookup:  0.151\r\n       time_connect:  0.154\r\n    time_appconnect:  0.324\r\n   time_pretransfer:  0.324\r\n      time_redirect:  0.000\r\n time_starttransfer:  0.331\r\n                    ----------\r\n         time_total:  0.347\r\nTue Feb  9 09:03:29 UTC 2016\r\n      time_namelookup:  0.151\r\n       time_connect:  0.154\r\n    time_appconnect:  0.385\r\n   time_pretransfer:  0.385\r\n      time_redirect:  0.000\r\n time_starttransfer:  0.391\r\n                    ----------\r\n         time_total:  0.404\r\nTue Feb  9 09:03:29 UTC 2016\r\n      time_namelookup:  0.151\r\n       time_connect:  0.155\r\n    time_appconnect:  0.348\r\n   time_pretransfer:  0.349\r\n      time_redirect:  0.000\r\n time_starttransfer:  0.357\r\n                    ----------\r\n         time_total:  0.374\r\nTue Feb  9 09:03:30 UTC 2016\r\n      time_namelookup:  0.151\r\n       time_connect:  0.155\r\n    time_appconnect:  0.408\r\n   time_pretransfer:  0.409\r\n      time_redirect:  0.000\r\n time_starttransfer:  0.417\r\n                    ----------\r\n         time_total:  0.433\r\nTue Feb  9 09:03:30 UTC 2016\r\n<\/pre>\n<p>pretty handy andy.<\/p>\n<p>With headers<\/p>\n<pre>\r\n# while ((1!=0)); do date; curl -IL -w \"@curl-format.txt\" -s \"https:\/\/www.scdn3.secure.raxcdn.com\/img\/upload\/3_sdsdsds6a9e80df0baa19863ffb8.jpg\"; sleep 180; done;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This is a simple one. Soa customer was complaining that after 3 minutes the cache time of the file on his CDN was changing. I wanted to built a way to test the consistency of the requests. Here is how &hellip; <a href=\"https:\/\/haxed.me.uk\/index.php\/2016\/02\/09\/testing-cdn-consistency-with-bash-time-curl-while-loop\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34,15,14,9,7,29,4],"tags":[],"class_list":["post-429","post","type-post","status-publish","format-standard","hentry","category-cdn","category-cloud","category-cloud-files","category-linux","category-management-tools","category-monitoring","category-networking"],"_links":{"self":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/429","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/comments?post=429"}],"version-history":[{"count":4,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/429\/revisions"}],"predecessor-version":[{"id":501,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/429\/revisions\/501"}],"wp:attachment":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/media?parent=429"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/categories?post=429"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/tags?post=429"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}