commit 946d3439b93be9bac9eb246d9ff40f9e02e259a8 from: Omar Polo date: Wed Jan 12 12:24:54 2022 UTC crank up cache limits delete pages that are older than one hour, and scan the cache only once every five minutes. The previous defaults were a bit too much conservative. commit - 1495fbb279fee499ef1cd0017feecdebe5d4a030 commit + 946d3439b93be9bac9eb246d9ff40f9e02e259a8 blob - d2aa0e3a6e1112829f4b897b9d2a90aa48c328cf blob + fed5701db9d4d1231f26afdf5888b67adc3f501b --- mcache.c +++ mcache.c @@ -37,7 +37,7 @@ static const char *gemtext_prefixes[] = { [LINE_PRE_END] = "```", }; -static struct timeval tv = { 60, 0 }; +static struct timeval tv = { 5 * 60, 0 }; static struct event timerev; static struct ohash h; @@ -76,7 +76,8 @@ clean_old_entries(int fd, short ev, void *data) unsigned int i; time_t treshold; - treshold = time(NULL) - 15 * 60; + /* delete pages older than an hour */ + treshold = time(NULL) - 60 * 60; for (e = ohash_first(&h, &i); e != NULL; e = ohash_next(&h, &i)) if (e->ts < treshold)