Out for a walk with the 5-y/o geokid we decided to check up on this cache to ensure it was still accessible in spite of the ongoing work to rearrange
the footpaths around here. Yup, it’s still accessible (and as devious as ever!).
Suppose you’re running an application on a Passenger + Nginx powered server and you want to add caching.
Perhaps your application has a dynamic, public endpoint but the contents don’t change super-frequently or it isn’t critically-important that the user always gets up-to-the-second
accuracy, and you’d like to improve performance with microcaching. How would you do that?
Where you’re at
Your configuration might look something like this:
1
2
3
4
5
6
7
server {
# listen, server_name, ssl, logging etc. directives go here# ...root/your/application;
passenger_enabledon;
}
What you’re looking for is proxy_cache and its sister directives, but you can’t just
insert them here because while Passenger does act act like an upstream proxy (with parallels like e.g. passenger_pass_header which mirrors the behaviour of proxy_pass_header), it doesn’t provide any of the functions you need to implement proxy caching
of non-static files.
Where you need to be
Instead, what you need to to is define a second server, mount Passenger in that, and then proxy to that second server. E.g.:
# Set up a cacheproxy_cache_path/tmp/cache/my-app-cachekeys_zone=MyAppCache:10mlevels=1:2inactive=600smax_size=100m;
# Define the actual webserver that listens for Internet traffic:server {
# listen, server_name, ssl, logging etc. directives go here# ...# You can configure different rules by location etc., but here's a simple microcache:location/ {
proxy_passhttp://127.0.0.1:4863; # Proxy all traffic to the application server defined belowproxy_cacheMyAppCache; # Use the cache defined aboveproxy_cache_valid2003s; # Treat HTTP 200 responses as valid; cache them for 3 secondsproxy_cache_use_staleupdating; # (Optional) send outdated response while background-updating cacheproxy_cache_lock on; # (Optional) only allow one process to update cache at once
}
}
# (Local-only) application server on an arbitrary port number to act as the upstream proxy:server {
listen 127.0.0.1:4863;
root/your/application;
passenger_enabledon;
}
The two key changes are:
Passenger moves to a second server block, localhost-only, on an arbitrary port number (doesn’t need HTTPS, of course, but if your application detects/”expects” HTTPS you
might need to tweak your headers).
Your main server block proxies to the second as its upstream, and you can add whatever caching directives you like.
Obviously you’ll need to be smarter if you host a mixture of public and private content (e.g. send Vary: headers from your application) and if you want different cache
durations on different addresses or types of content, but there are already great guides to help with that. I only wrote this post because I spent some time searching for (nonexistent!)
passenger_cache_ etc. rules and wanted to save the next person from the same trouble!
0/2 for the geokids and I this morning. Hunted a long while on and around the obvious place, later reassured by the hint, but eventually expanded our search based on recent logs (which
suggest the hint is wrong). Interrupted by a suspicious local we decided to make an excuse to leave. Hint, possibly coordinates, maybe more needs looking at by CO.
I really love Dungeondraft, an RPG battle map generator. It’s got great compatibility with
online platforms like Foundry VTT and Roll20, but if you’re looking to make maps for tabletop play,
there’s a few tips I can share:
Planning and designing
Dungeondraft has (or can be extended with) features to support light levels and shadow-casting obstructions, openable doors and windows, line-of sight etc… great to have when you’re
building for Internet-enabled tabletops, but pointless when you’re planning to print out your map! Instead:
Think about scale: I’m printing to A4 sheets and using inch-size squares, so every 11 x 8 squares equates to one sheet of paper. Knowing this, I can multiply-up to a
whole number of sheets of paper and this informs my decisions about how to best make use of the maps (and what will and won’t fit on my dining table!).
Focus on legibility: Your printer probably won’t have the same kind of resolution as your screen, and your players can’t “zoom in” to get details. Play with the grid
styles (under Map Settings) to find what works best for you, and try not to clash with your floor patterns. If you’re printing in monochrome, use the “Printer-Friendly” camera filter
(also under Map Settings, or in the Export Options dialog) to convert to gorgeous line-art. Make sure critical elements have sufficient contrast that they’ll stand out when printed or
your players might walk right over that chest, campfire, or bookshelf.
Think about exposure: You don’t get digital “fog of war” on the tabletop! Think about how you’re going to reveal the map to your players: plan to print in multiple
sections to put together, jigsaw style, or have card to “cover” bits of the map. Think about how the tool can help you here: e.g. if you’ve got multiple buildings the players can
explore, use a higher “level” or roof layer to put roofs on your buildings, then print the relevant parts of that level separately: now you’ve got a thematic cover-up that you can
remove to show the insides of the building. Go the other way around for secret doors: print the empty wall on your main map (so players can’t infer the location of the secret door by
the inclusion of a cover-up) and the secret door/passage on the overlay, so you can stick it onto the map when they find it.
Printing it out
There’s no “print” option in Dungeondraft, so – especially if your map spans multiple “pages” – you’ll need a multi-step process to printing it out. With a little practice, it’s not too
hard or time-consuming, though:
Export your map (level by level) from Dungeondraft as PNG files. The default settings are fine, but pay attention to the
“Overlay level” setting if you’re using smart or complex cover-ups as described above.
To easily spread your map across multiple pages, you’ll need to convert it to a PDF. I’m using Gimp to do this. Simply open the PNG in Gimp, make any post-processing/last minute changes that you couldn’t manage in Dungeondraft, then click File >
Export As… and change the filename to have a .pdf extension. You could print directly from Gimp, but in my experience PDF reader software does a much better job at multi-page printing.
Open your PDF in an appropriate reader application with good print management. I’m using Foxit, which is… okay? Print it, selecting “tile large pages” to tell it to print across multiple sheets. Assuming you’ve produced a map an appropriate size
for your printer’s margins, your preview should be perfect. If not, you can get away with reducing the zoom level by up to a percent or two without causing trouble for your miniatures.
If you’d like the page breaks to occur at specific places (for exposure/reveal reasons), go back to Gimp and pad one side of the image by increasing the canvas size.
Check the level of “overlap” specified: I like to keep mine low and use the print margins as the overlapping part of my maps when I tape them together, but you’ll want to see how your
printer behaves and adapt accordingly.
If you’re sticking together multiple pages to make a single large map, trim off the bottom and right margins of each page: if you printed with cut marks, this is easy enough even
without a guillotine. Then tape them together on the underside, taking care to line-up the features on the map (it’s not just your players who’ll appreciate a good, visible grid: it’s
useful when lining-up your printouts to stick, too!).
I keep my maps rolled-up in a box. If you do this too, just be ready with some paperweights to keep the edges from curling when you unfurl them across your gaming table. Or cut into
separate rooms and mount to stiff card for that “jigsaw” effect! Whatever works best for you!
Imagine a personal heating system that works indoors as well as outdoors, can be taken anywhere, requires little energy, and is independent of any infrastructure. It exists – and is
hundreds of years old.
A hot water bottle is a sealable container filled with hot water, often enclosed in a textile cover, which is directly placed against a part of the body for thermal comfort. The hot
water bottle is still a common household item in some places – such as the UK and Japan – but it is largely forgotten or disregarded in most of the
industrialised world. If people know of it, they usually associate it with pain relief rather than thermal comfort, or they consider its use an outdated practice for the poor and
the elderly.
…
Imagine my surprise to discover that not only are hot water bottles confined almost-entirely to the UK and Japan (more-strictly, I suppose the article should say “the British Isles”;
friends in Ireland tell me that they’re popular there too), but that they’re so distinctly confined to these isles that English speakers elsewhere in the world need this
article to explain to them what a hot water bottle is and why they’d want one!
I’m a fan of hot water bottles; I’ll sometimes take one – or even two, during a cold snap – to bed. But reading this article feels like reading a
guide for aliens living on Earth: explaining everyday things as if you’d never come across them before.
I’m hoping to find the 2022-02-19 52 -2 hashpoint one day earlier and one graticule over, and
I think I can stretch the range on the electric car enough to be able to return home via this hashpoint too.
Update: managed to change the car after finding the 2022-02-19 52 -2 point, so I can make
this. Probably be there about midday, weather-permitting.
I didn’t expect much of this hashpoint, but I wanted the excuse to recharge the car before going for another leg of my journey – either a trip up to visit a friend in Lichfield or else
a hashing expedition one graticule further East where today’s hashpoint seemed to be in a graveyard! But more on that later.
I parked at the Morrisons car park at (52.757778, -1.752222) at 14:48 and hooked up to the charger there (once I eventually found it). I had some difficulty making it work, but it
seemed to get started eventually. Then I began my walk to the hashpoint. This was far from the picturesque walk of yesterday, taking me through a series of housing estates that were
nondescript at best, unpleasantly scuzzy at worst. Shooting video as I walked, I was at one point loudly mocked by a group of young men passing in an artificially-loud car, but it was
an activity that soon had to end anyway as the rain began to pour down. At around 15:11 my GPSr ran out of battery power (I’d failed to
find its charging cable the night before) and there’s a clear gap in my tracklog: fortunately I was also equipped with not one but two backup devices (my phone, of course, and my
watch), so I was able to continue heading in the right direction, and when I found a convenience store near (52.739167, -1.998333) I bought some AA batteries (my GPSr can have its rechargeable battery removed and 3 × AA batteries put in its place to allow it to continue) and pressed on to the hashpoint.
As anticipated, the hashpoint was on a road dividing a light industrial park from a housing estate, right outside a plant specialising in bending plate aluminium; I reached it at
15:23:48. I walked back the same route as the rain began to fall more and more heavily: by the time I reached the car it had become torrential. The dubious charging point I’d used had
taken £16 from my bank card but provided only enough charge to take the car from 66% to 67% battery, which – combined with the rapidly-worsening weather – made me rethink my plans to
visit Lichfield or explore further East and I instead used my remaining distance to take a long (slow, wet, diversion-filled) drive home. Ugh.
Tracklog
My GPSr kept a tracklog of my entire two-day expedition:
A hard walk to an easy find, but this cache has definitely caught the worst of the stormy conditions. Its hiding place has flooded and the container is drenched. Dried as best I could,
but it needs CO attention. TFTC.
Getting down the muddy bank (picture attached) to this one was a bit spicy! Like those before me, I found the cache wedged tight into its hiding space. But unlike them, I was able to
construct a crude lever with which to set it free! SL, TFTC.
Hard to believe any cache could survive the gale force winds ripping over those hilltop. Hunted for some time, including getting a view as per the hint, without luck.
Found after an extended hunt, not where the hint would suggest. Looks like it blew quite a way away! Returned to pave specified by coordinates and hint. Log extremely wet, hard to sign.
You were right about the views from up here, though!