mod_tile 0.9.1
Renders map tiles with Mapnik and serves them using Apache HTTP Server
Loading...
Searching...
No Matches
cache_expire.h File Reference

Go to the source code of this file.

Macros

#define HTCP_EXPIRE_CACHE   1
 Feature flag enabling HTCP (Hyper Text Caching Protocol) tile cache purging.
#define HTCP_EXPIRE_CACHE_PORT   "4827"
 Default UDP destination port string for HTCP cache purge (CLR) requests.

Functions

void cache_expire (int sock, const char *host, const char *uri, int x, int y, int z)
 Format a tile URL from Z/X/Y coordinates and send an HTCP purge request.
int init_cache_expire (const char *htcphost)
 Initialize and connect a UDP socket to an HTCP caching server.

Macro Definition Documentation

◆ HTCP_EXPIRE_CACHE

#define HTCP_EXPIRE_CACHE   1

Feature flag enabling HTCP (Hyper Text Caching Protocol) tile cache purging.

◆ HTCP_EXPIRE_CACHE_PORT

#define HTCP_EXPIRE_CACHE_PORT   "4827"

Default UDP destination port string for HTCP cache purge (CLR) requests.

Function Documentation

◆ cache_expire()

void cache_expire ( int sock,
const char * host,
const char * uri,
int x,
int y,
int z )

Format a tile URL from Z/X/Y coordinates and send an HTCP purge request.

Constructs a URL of the form http://<host><uri><z>/<x>/<y>.png (assuming uri includes leading and trailing slashes) and passes it to cache_expire_url().

Parameters
sockConnected UDP socket descriptor returned by init_cache_expire(). If negative, the function returns immediately without action.
hostTarget cache hostname or IP address (e.g., "tile.openstreetmap.org").
uriBase URI path prefix for the tileset (e.g., "/").
xTile X coordinate.
yTile Y coordinate.
zTile zoom level.

◆ init_cache_expire()

int init_cache_expire ( const char * htcphost)

Initialize and connect a UDP socket to an HTCP caching server.

Resolves htcphost using HTCP_EXPIRE_CACHE_PORT and attempts to create and connect a SOCK_DGRAM socket against each resolved address until one succeeds.

Parameters
htcphostHostname or IP address string of the HTCP cache server.
Returns
Connected socket file descriptor on success, or -1 on failure.