Unit test Python library for testing cache systems like varnish
Based on the work of @onyxfish (https://gist.github.com/onyxfish)
- cachetest.py : productive
| # +--------- Minute (0-59) | Output Dumper: >/dev/null 2>&1 | |
| # | +------- Hour (0-23) | Multiple Values Use Commas: 3,12,47 | |
| # | | +----- Day Of Month (1-31) | Do every X intervals: */X -> Example: */15 * * * * Is every 15 minutes | |
| # | | | +--- Month (1 -12) | Aliases: @reboot -> Run once at startup; @hourly -> 0 * * * *; | |
| # | | | | +- Day Of Week (0-6) (Sunday = 0) | @daily -> 0 0 * * *; @weekly -> 0 0 * * 0; @monthly ->0 0 1 * *; | |
| # | | | | | | @yearly -> 0 0 1 1 *; | |
| # * * * * * COMMAND |
| curl --include \ | |
| --no-buffer \ | |
| --header "Connection: Upgrade" \ | |
| --header "Upgrade: websocket" \ | |
| --header "Host: example.com:80" \ | |
| --header "Origin: http://example.com:80" \ | |
| --header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \ | |
| --header "Sec-WebSocket-Version: 13" \ | |
| http://example.com:80/ |
| #!/bin/bash | |
| # this script will | |
| # a. crawl the designated site X levels deep to generate a urls list | |
| # b. completely purge all urls on the desisgnated varnish servers for the designated url | |
| # c. clear cache on nginx / mod pagespeed for the designated app servers | |
| # d. individually warm all the listed urls on each designated varnish server | |
| # e. rewarm them in case pagespeed sent a purge request | |
| # define some variables |
Unit test Python library for testing cache systems like varnish
Based on the work of @onyxfish (https://gist.github.com/onyxfish)
| #!/usr/bin/env python | |
| import cookielib | |
| import json | |
| import re | |
| import random | |
| import unittest | |
| import requests | |
| from wordpress_xmlrpc import Client, WordPressComment, WordPressPost |