-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dirty tiles cached for 7 days #441
Comments
Thank you @nrenner, I assume you are suggesting changing this: Line 527 in 1f81434
To something like this: if (state == tileOld || state == tileVeryOld) { Otherwise, please feel free to offer up a suggested fix for your issue. I am still not entirely clear about what your proposed solution would be. |
if (state == tileOld || state == tileVeryOld) { Yes, that should fix the issue and is what I had in mind. But I'm just theoretically reading on GitHub, don't really know the code and don't have a running instance to test, so someone else should probably confirm. I'm just investigating why people were still seeing vandalized tiles days after the revert, and I think this bug might have been one of the main reasons. |
The same issue applies to Line 1150 in 1f81434
The tile |
I can confirm this problem, you will also see it in the mod tile stats, e.g. at ysera.osm.org/mod_tile ModTileCacheDurationDirty is never applied in modern buildups as the planet-import-complete time system is not used but dirtying of tiles via expiry from osm2pgsql, pushing them 20 years back and by that tileVeryOld and not tileOld. This means that dirty/stale tiles returned in case of overloaded tile renderers are send out to the cdn with a way-too-large expire header timeframe and not the time set by ModTileCacheDurationDirty. |
See also operations#1096 for examples and trying to infer from indirect hints.
From just looking at the code¹, I guess
state
inadd_expiry
is actuallytileVeryOld
² and nottileOld
for dirty tiles:mod_tile/src/mod_tile.c
Lines 526 to 527 in 1f81434
Determined in
tile_state
:mod_tile/src/mod_tile.c
Lines 442 to 448 in 1f81434
Assuming the default³ of 1 year for
scfg->veryold_threshold
, 20-year-old expired tiles will be older and thereforetileVeryOld
.So, dirty tiles would not get a low maxAge as originally intended. Instead, maxAge would be derived from modified time (-20 years) and clamped to
ModTileCacheDurationMax
, resulting in aCache-Control: max-age=604800
.¹ not entirely sure if this is the code actually used for OSMF render servers and in what version; permalinks for current master
²
tileVeryOld
was introduced 11 years ago, apperently without adjusting theadd_expiry
code³ searching for
ModTileVeryOldThreshold
in chef does not find any overriding config, default should be one year:mod_tile/includes/render_config.h
Lines 47 to 49 in 1f81434
The text was updated successfully, but these errors were encountered: