Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#1040 closed defect (fixed)

mod_tile sets HTTP expiry in the past, if osm2pgsql delayed

Reported by: Grant Slater Owned by: jburgess@…
Priority: minor Milestone:
Component: mapnik Version:
Keywords: Cc:

Description

If the osm2pgsql import is delayed, mod_tile sets a tile HTTP expiry in the past.

Currently:

nextPlanet = (state == tileCurrent) ? (getPlanetTime(r) + apr_time_from_sec(PLANET_INTERVAL)) : r->request_time;
holdoff = apr_time_from_sec(3 * 60 * 60) * (rand() / (RAND_MAX + 1.0));
expires = nextPlanet + holdoff;

Sudo code fix:

nextPlanet = (state == tileCurrent AND (getPlanetTime(r) + apr_time_from_sec(PLANET_INTERVAL)) < r->request_time )) ? (getPlanetTime(r) + apr_time_from_sec(PLANET_INTERVAL)) : r->request_time;
holdoff = apr_time_from_sec(3 * 60 * 60) * (rand() / (RAND_MAX + 1.0));
expires = nextPlanet + holdoff;

Change History (2)

comment:1 Changed 11 years ago by jonb

Resolution: fixed
Status: newclosed

(In [9098]) mod_tile: Fix negative expiry times. Closes #1040

comment:2 Changed 11 years ago by Grant Slater

Summary: mod_tile sets HTTP expiry in the paste, if osm2pgsql delayedmod_tile sets HTTP expiry in the past, if osm2pgsql delayed

correct bug title typo. pedantic=yes

Note: See TracTickets for help on using tickets.