Freshness and Recrawling

Keeping a crawled collection current as pages change. Modeling page changes as a Poisson process, deriving expected freshness and age step by step, why revisiting pages in proportion to how often they change is worse than revisiting them uniformly, the optimal revisit rates found with a Lagrange multiplier, and how conditional requests, sitemaps, and notifications make recrawling cheaper. The estimate of a page's change rate from detected changes, and worked problems.

If a page's changes form a Poisson process with rate $\lambda$ and it is revisited every $I$ days, its copy is fresh a fraction $\bar{F} = (1 - e^{-r})/r$ of the time, with $r = \lambda I$ the expected number of changes between visits: 63.2 percent when visits match changes. Under a fixed budget, visiting pages in proportion to their change rates loses to visiting them equally: 0.632 against 0.685 mean freshness for two pages changing 9 times and once a day, with 10 visits. The best rates equalize the freshness gained by one more visit, and skip pages that change too fast to keep fresh. From $X$ detected changes in $n$ visits, the change rate is estimated as $-\ln(1 - X/n)/I$.

The crawl of this site fetched 82 pages. The site has since grown to several hundred pages, among them every article of this topic, so a copy from that crawl would now be out of date. A stale copy may be ranked for words the page no longer contains, or shown with a snippet that no longer matches. With a fixed budget of fetches, how often should a crawler revisit each page? The answer derived below is that the best rates equalize the freshness gained by one more visit across pages. They rise with a page's change rate only up to a point, and pages that change too fast to keep fresh get no visits at all.

A copy is fresh when it is identical to the live page. Keeping copies fresh is one of the features Manning, Raghavan, and Schütze (2008, §20.1.2) say a crawler should provide: it should run continuously and revisit each page at a rate suited to how often that page changes. Choosing those rates is a resource allocation problem, and its best solution is not the obvious one.

Here is the route. First we model page changes as random events. Then we derive how fresh, and how out of date, one copy is on average. Next we find that visiting pages in proportion to how often they change loses to visiting them equally, and a Lagrange multiplier gives the best division. Then come the estimate of a page's change rate and cheaper revisits, and worked problems close the article.

How pages change

Studies that fetched the same pages repeatedly found that change is very uneven. Cho and Garcia-Molina (2000a) crawled 720,000 pages from 270 popular sites every day for four months. Some pages changed every time they were visited, and many did not change at all during the study. Commercial sites changed far more often than educational or government ones. Fetterly, Manasse, Najork, and Wiener (2003) followed 151 million pages weekly for eleven weeks. Most of the changes they saw were small, often limited to markup, and a page's past changes were a good predictor of its future ones.

Cho and Garcia-Molina found that the changes of an individual page were well described by a Poisson process: changes arrive independently at random times, at an average rate $\lambda$ that differs from page to page. A page with $\lambda = 2$ per day changes twice a day on average. On a given day it may still change zero, one, three, or more times. Of the process, which the Poisson distribution treats in full, we need one fact. The waiting time $T$ from any moment until the next change has the exponential distribution, with density $\lambda e^{-\lambda t}$. So the probability that a page has not changed in the $t$ days since it was fetched is

$$P[T > t] = \int_t^\infty \lambda e^{-\lambda s}\, ds = e^{-\lambda t}.$$

The model is memoryless: how long ago the page last changed says nothing about when it will change next. That property makes the calculations below short.

The model is an approximation, and it fits some pages badly. A page that is regenerated on a fixed schedule, such as a bulletin rewritten every morning, changes at regular intervals and not at exponentially distributed ones, and what happened yesterday then says a great deal about today. Everything below is a statement about pages whose changes are well described by the Poisson model.

Measuring freshness

With random changes, a crawler can only control how current its collection is on average. Cho and Garcia-Molina (2003a) defined two measures:

  • Freshness is the fraction of the collection's pages whose copies are up to date, that is, identical to the live page.
  • Age is how long a page's copy has been out of date, averaged over the collection. A current copy has age zero.

Freshness counts how many copies are stale. Age also counts how stale they are. Both change over time, so a crawler is judged by their averages over a long period.

Freshness of one page

Here is the idea. A copy stays fresh from a visit until the first change, so its chance of being fresh decays like the chance of no change. Long-run freshness averages that decay between visits.

The formal version. Follow one page, with change rate $\lambda$, that the crawler revisits every $I$ days, so its visit frequency is $f = 1/I$. Just after a visit, at time $0$, the copy is certainly fresh. At time $t$ before the next visit, it is fresh only if the page has not changed since time $0$, which has probability $e^{-\lambda t}$. Write $F(t)$ for the freshness of the copy at time $t$, which is 1 or 0. Its expected value is

$$E[F(t)] = 1 \cdot e^{-\lambda t} + 0 \cdot \left(1 - e^{-\lambda t}\right) = e^{-\lambda t}.$$

The next visit resets the copy, so the same pattern repeats in every interval. The long-run average freshness is the average of $e^{-\lambda t}$ over one interval:

$$\bar{F} = \frac{1}{I} \int_0^I e^{-\lambda t}\, dt = \frac{1}{I} \left[ -\frac{e^{-\lambda t}}{\lambda} \right]_0^I = \frac{1 - e^{-\lambda I}}{\lambda I}.$$

Only the product $\lambda I$ appears. Write $r = \lambda I = \lambda / f$ for the expected number of changes between visits. Then

$$\bar{F}(r) = \frac{1 - e^{-r}}{r}.$$

Example (visited as often as it changes). A page that changes once a day on average, $\lambda = 1$, and is visited daily, $I = 1$, has a fresh copy 63.2 percent of the time: $\bar{F}(1) = 1 - e^{-1} = 0.632$, neither nearly always nor about half. The probability that the copy is fresh falls from 1 just after the visit to $e^{-0.5} = 0.607$ at noon and $e^{-1} = 0.368$ just before the next visit. Even though the crawler visits exactly as often as the page changes, the copy is stale more than a third of the time. Changes come at random moments, and some days bring two changes and others none.

Age of one page

Age needs one more step: averaging how long the copy has been wrong over the possible times of the first change. If the page first changes at time $s$ after the visit, then at a later time $t$ the copy has been stale for $t - s$. Weight each possible first-change time $s$ by its density $\lambda e^{-\lambda s}$:

$$E[A(t)] = \int_0^t (t - s)\, \lambda e^{-\lambda s}\, ds = t - \frac{1 - e^{-\lambda t}}{\lambda}.$$

The integral splits into two. The first part is $t \int_0^t \lambda e^{-\lambda s}\, ds = t(1 - e^{-\lambda t})$. The second, by parts with $u = s$ and $dv = \lambda e^{-\lambda s}\, ds$, is

$$\int_0^t s\, \lambda e^{-\lambda s}\, ds = \Big[ -s\, e^{-\lambda s} \Big]_0^t + \int_0^t e^{-\lambda s}\, ds = -t e^{-\lambda t} + \frac{1 - e^{-\lambda t}}{\lambda}.$$

Subtracting, the terms $t e^{-\lambda t}$ cancel and $t - (1 - e^{-\lambda t})/\lambda$ remains. If the page has not changed by time $t$ the age is zero, so that case adds nothing.

Averaging over the interval as before, term by term:

$$\frac{1}{I}\int_0^I t\, dt = \frac{I}{2}, \qquad \frac{1}{I}\int_0^I \frac{1}{\lambda}\, dt = \frac{1}{\lambda}, \qquad \frac{1}{I}\int_0^I \frac{e^{-\lambda t}}{\lambda}\, dt = \frac{1 - e^{-\lambda I}}{\lambda^2 I}.$$

The average age is the first minus the second plus the third. Writing $r = \lambda I$, so that $1/\lambda = I/r$ and $1/(\lambda^2 I) = I/r^2$,

$$\bar{A} = \frac{I}{2} - \frac{1}{\lambda} + \frac{1 - e^{-\lambda I}}{\lambda^2 I} = I \left( \frac{1}{2} - \frac{1}{r} + \frac{1 - e^{-r}}{r^2} \right).$$

Back to the page that changes daily and is visited daily. With $I = 1$ and $r = 1$, $\bar{A} = \tfrac{1}{2} - 1 + (1 - e^{-1}) = 0.5 - 1 + 0.632 = 0.132$ days, about 3.2 hours. Expected age rises slowly at first, since the page probably has not changed yet, and then grows almost linearly.

Expected freshness and age of one page that changes once a day on average and is visited every day. Notice that each visit resets both curves, that freshness falls fastest just after a visit, and that expected age starts flat before growing almost linearly. Over a day, freshness averages 0.632 and age 0.132 days.
Expected freshness and age of one page that changes once a day on average and is visited every day. Notice that each visit resets both curves, that freshness falls fastest just after a visit, and that expected age starts flat before growing almost linearly. Over a day, freshness averages 0.632 and age 0.132 days.

Both formulas were checked against a simulation of Poisson changes, 30 runs of 2,000 simulated days each. For the daily case, the median average freshness was 0.6319, with the middle half of the runs between 0.6263 and 0.6351, against the formula's 0.6321. The median average age was 0.1324 days, against 0.1321.

How often to visit one page

The freshness formula answers practical questions directly. For the page that changes once a day:

Visits per day $r = \lambda / f$ Average freshness Average age
0.5 2 0.432 10.4 hours
1 1 0.632 3.2 hours
2 0.5 0.787 0.9 hours
4 0.25 0.885 0.2 hours
10 0.1 0.952 0.04 hours

Doubling the visit rate from one to two a day raises freshness by 0.155, and doubling it again adds only 0.098. Each extra visit buys less than the one before. Average freshness of 0.8 requires $r \le 0.464$, that is, about 2.15 visits for every change. Values are rounded to three places, and ages to a tenth of an hour except the last.

Average freshness of a page as a function of r, the expected number of changes between visits. Notice how slowly the curve approaches 1 as r falls: at one change per visit the copy is fresh 63.2 percent of the time, and keeping it fresh 80 percent of the time needs r of at most 0.464, a little more than two visits per change.
Average freshness of a page as a function of r, the expected number of changes between visits. Notice how slowly the curve approaches 1 as r falls: at one change per visit the copy is fresh 63.2 percent of the time, and keeping it fresh 80 percent of the time needs r of at most 0.464, a little more than two visits per change.

Proportional is not optimal

A crawler has a fixed budget of fetches per day. The intuitive policy is to visit each page in proportion to how often it changes, so that a page changing ten times as often is visited ten times as often. Cho and Garcia-Molina (2003a) showed that this proportional policy is worse for freshness than simply visiting every page equally often.

Two pages

A two-page example, with the change rates Cho and Garcia-Molina use (2000b), shows why. One page changes 9 times a day on average and the other once a day. The crawler can make 10 visits a day in total.

Example (five and five against nine and one). Giving 5 visits to each page yields a higher mean freshness than giving 9 to the fast page and 1 to the slow one, by 0.685 to 0.632. The table also shows the best split, found by search:

Policy Visits per day Freshness of fast page Freshness of slow page Mean freshness
Uniform 5 and 5 0.464 0.906 0.685
Proportional 9 and 1 0.632 0.632 0.632
Best split 6.89 and 3.11 0.558 0.855 0.707

The proportional policy gives each page the same $r = 1$, and so the same freshness as the running case, 0.632. It spends 9 visits keeping the fast page fresh 63 percent of the time. Moving four of those visits to the slow page costs the fast page some freshness, but it raises the slow page from 63 to 91 percent. Each visit to a page that changes very often buys little, because its copy goes stale again almost immediately. The best allocation still gives the fast page more visits than the slow one, but far fewer than in proportion to its change rate.

Mean freshness of the two pages for every way of dividing 10 visits a day between them. Notice that the curve peaks at 6.89 visits to the fast page, that the uniform split sits close to the peak, and that the proportional split, 9 visits to the fast page, lies on the steep part of the curve, well below it.
Mean freshness of the two pages for every way of dividing 10 visits a day between them. Notice that the curve peaks at 6.89 visits to the fast page, that the uniform split sits close to the peak, and that the proportional split, 9 visits to the fast page, lies on the steep part of the curve, well below it.

The marginal value of a visit

The best split can be found without searching. Here is the idea: moving a visit helps whenever the receiving page gains more than the giving page loses, so at the best split one more visit is worth the same on both.

The formal version. Write the average freshness of a page as a function of its visit frequency,

$$\bar{F}(\lambda, f) = \frac{f}{\lambda}\left(1 - e^{-\lambda / f}\right).$$

Differentiate with respect to $f$ by the product rule. The derivative of $f/\lambda$ is $1/\lambda$. The derivative of $1 - e^{-\lambda/f}$ is $-e^{-\lambda/f}$ times the derivative of $-\lambda/f$, which is $\lambda/f^2$, so it equals $-(\lambda/f^2)\,e^{-\lambda/f}$. Together,

$$\frac{\partial \bar{F}}{\partial f} = \frac{1}{\lambda}\left(1 - e^{-\lambda/f}\right) - \frac{f}{\lambda} \cdot \frac{\lambda}{f^2}\, e^{-\lambda/f} = \frac{1 - e^{-r}}{\lambda} - \frac{e^{-r}}{f}, \qquad r = \frac{\lambda}{f}.$$

This is the freshness gained per additional visit.

Under the proportional policy, this marginal value is 0.029 for the fast page and 0.264 for the slow one. A visit taken from the fast page loses about 0.029 of its freshness, and the same visit given to the slow page gains about 0.264, so the move is worth making. Under the uniform policy the comparison runs the other way, 0.060 for the fast page against 0.018 for the slow. So a few visits should move back to the fast page. At the optimum the two marginal values are equal, at 0.0417, and no transfer of a visit in either direction helps. That optimum is the 6.89 and 3.11 split the search found.

This is the method of Lagrange multipliers, which Cho and Garcia-Molina (2000b) use for the general problem. The aim is to maximize the mean freshness of $N$ pages, $\frac{1}{N}\sum_i \bar{F}(\lambda_i, f_i)$, subject to a fixed total $\sum_i f_i$. The optimal frequencies satisfy

$$\frac{\partial \bar{F}}{\partial f}(\lambda_i, f_i) = \mu \quad \text{for every page that is visited at all,}$$

for one constant $\mu$ chosen so that the frequencies add up to the budget. Two facts make this condition easy to use.

  • The second derivative is negative. Differentiating the two terms of the first derivative, with $dr/df = -\lambda/f^2$: the first gives $\frac{e^{-r}}{\lambda} \cdot \left(-\frac{\lambda}{f^2}\right) = -\frac{e^{-r}}{f^2}$, and the second gives $-\frac{e^{-r}}{f} \cdot \frac{\lambda}{f^2} + \frac{e^{-r}}{f^2}$. The terms $\pm e^{-r}/f^2$ cancel, leaving $\frac{\partial^2 \bar{F}}{\partial f^2} = -\frac{\lambda e^{-r}}{f^3} < 0$. So each page's freshness is concave in its visit rate: every extra visit is worth less than the one before. The equal-marginal point is therefore a maximum, not a minimum.
  • As $f$ approaches 0, the marginal value approaches $1/\lambda$, because $r = \lambda/f$ grows without bound, $e^{-r}$ falls to zero faster than $1/f$ grows, and the first term tends to $1/\lambda$. When visits are rare, each visit leaves the copy fresh until the next change, which takes $1/\lambda$ days on average, and that is all a visit can buy. A page whose $1/\lambda$ is below $\mu$ is therefore not worth even one visit, and the optimum skips it entirely.

With a small budget the effect is stark. With only one visit a day for the same two pages, the optimum gives it all to the slow page, for a mean freshness of 0.316. The uniform split gives 0.244 and the proportional one 0.100.

Five pages

Cho and Garcia-Molina (2000b) illustrate the general solution with five pages that change 1, 2, 3, 4, and 5 times a day and a budget of 5 visits a day. Solving the Lagrange condition numerically gives $\mu = 0.2164$.

Example (the page that gets no visits). Of the five pages, the one that changes 5 times a day gets no visits at all: a visit to it is worth at most $1/5 = 0.2$, less than $\mu$. Every other page has $1/\lambda \ge 0.25$, above $\mu$. The full solution:

Change rate (per day) 1 2 3 4 5
Optimal visits per day 1.15 1.36 1.35 1.14 0.00
Proportional visits per day 0.33 0.67 1.00 1.33 1.67

The page that changes most often is not visited at all, and the page that changes four times a day gets fewer visits than the one that changes twice. The mean freshness is 0.374 for the optimum, 0.365 for uniform visits, and 0.317 for proportional ones. The computed frequencies match the values Cho and Garcia-Molina report.

Optimal visits a day as a function of a page's change rate, for the five-page example (dots). Notice that the optimal rate rises with the change rate only up to about 2.5 changes a day, then falls, and is zero for pages changing more than about 4.6 times a day. The proportional policy (dashed) does the opposite for fast-changing pages.
Optimal visits a day as a function of a page's change rate, for the five-page example (dots). Notice that the optimal rate rises with the change rate only up to about 2.5 changes a day, then falls, and is zero for pages changing more than about 4.6 times a day. The proportional policy (dashed) does the opposite for fast-changing pages.

Should a crawler then neglect its busiest pages? That overstates the result.

  • Cho and Garcia-Molina showed that the policy that maximizes freshness visits pages with moderate change rates most. It visits pages that change extremely often less than slower ones, since keeping them fresh is a losing battle.
  • The result depends on the measure. Optimizing average age instead of freshness gives more visits to faster-changing pages, because a stale copy of a fast page grows old quickly and age counts how old. The same Lagrange argument applies with the age formula in place of the freshness formula. Differentiating $\bar{A} = \frac{1}{2f} - \frac{1}{\lambda} + \frac{f}{\lambda^2}\left(1 - e^{-\lambda/f}\right)$ gives $\frac{\partial \bar{A}}{\partial f} = -\frac{1}{2f^2} + \frac{1 - e^{-r}}{\lambda^2} - \frac{e^{-r}}{\lambda f}$. Differentiating again, with $dr/df = -\lambda/f^2$: the first term gives $\frac{1}{f^3}$, the second gives $-\frac{e^{-r}}{\lambda f^2}$, and the third gives $-\frac{e^{-r}}{f^3} + \frac{e^{-r}}{\lambda f^2}$. The terms $\pm e^{-r}/(\lambda f^2)$ cancel, leaving $\frac{\partial^2 \bar{A}}{\partial f^2} = \frac{1 - e^{-r}}{f^3} > 0$. So each page's age is convex in its visit rate, and a point where the derivatives are equal is a minimum. As $f$ approaches 0 the derivative falls without bound, because of the term $-1/(2f^2)$, so a first visit always pays and, unlike the freshness optimum, the age optimum visits every page. The mean age is therefore smallest where this derivative is the same for every page. Solving that condition numerically for the five-page example gives 0.83, 0.97, 1.03, 1.07 and 1.09 visits a day for the pages that change 1 to 5 times a day. The rates stay close to uniform and rise with the change rate. Cho and Garcia-Molina (2000b) print 0.84, 0.97, 1.03, 1.07 and 1.09 for the same example. Our lowest rate is 0.8349, which rounds to 0.83. Their 0.84 differs from it by less than 0.01, and the other four agree.
  • A real crawler also weighs each page by its importance. A stale copy of a popular page costs more than a stale copy of an obscure one, so important pages get more visits than their change rate alone would justify.

Estimating the change rate

All of this assumes the crawler knows each page's $\lambda$. It does not, because it sees a page only when it visits. If the page differs from the last visit, it has changed at least once, but the crawler cannot tell how many times. A naive estimate divides the number of visits at which a change was detected by the time observed. It is biased low for pages that change often, since several changes between visits count as one.

The Poisson model supplies the correction. Here is the idea: a visit does not count changes, it only reports whether there was at least one, and the model says how often that should happen.

The formal version. Suppose the page is visited $n$ times at a fixed interval $I$, and a change is detected at $X$ of the visits. Under the model, an interval contains no change with probability $e^{-\lambda I}$, so each visit detects a change with probability $p = 1 - e^{-\lambda I}$, independently of the others. The number of detections $X$ is then binomial with $n$ trials and success probability $p$, and the value of $p$ that makes the observed count most likely is the observed fraction, $\hat{p} = X/n$. Solving $\hat{p} = 1 - e^{-\lambda I}$ for $\lambda$ gives the estimate

$$\hat{\lambda} = -\frac{1}{I} \ln\left(1 - \frac{X}{n}\right).$$

The naive estimate is $X/(nI)$. Since $-\ln(1 - x) = x + x^2/2 + x^3/3 + \cdots$ is larger than $x$ for every $x$ between 0 and 1, the corrected estimate is always the larger of the two. The two agree when detections are rare and differ most when nearly every visit finds a change.

The estimate fails when every visit detects a change: with $X = n$ the logarithm is of zero. The form usually given, following Cho and Garcia-Molina (2003b, §4.2), adds 0.5 inside the logarithm, $-\frac{1}{I}\ln\left(\frac{n - X + 0.5}{n + 0.5}\right)$, which is finite even when $X = n$. The estimator derived above is the one this article relies on. The Poisson Process (Proposition 2) works out how precise it is and which visit interval makes it most precise: about 1.6 expected changes between visits.

Now the check. A simulated page changes twice a day on average and is visited daily for 1,000 days, 30 times with different seeds. A daily visit detects a change with probability $1 - e^{-2} = 0.865$. The naive estimate has a median of 0.861 changes a day over the 30 runs, less than half the true rate of 2. The estimate $-\ln(1 - X/n)/I$ has a median of 1.970, with the middle half of the runs between 1.959 and 2.025. With 0.5 added inside the logarithm the median is 1.967, so with 1,000 visits the 0.5 hardly matters.

Cheaper revisits

Revisiting is less costly when the server can say that nothing has changed.

  • Conditional requests. When a server sends a page, it may include an ETag, an identifier for that version of the page, and a Last-Modified date. On the next visit, the crawler sends them back in If-None-Match and If-Modified-Since headers. If the page has not changed, the server answers with status 304 (Not Modified) and no body (Fielding, Nottingham, and Reschke, 2022). On this site, a stylesheet fetched a second time with its validators came back as a 304 with no body, instead of the 18,198 bytes it had at the time. The site's pages are generated by the application on each request and send no validators, so every revisit transfers the whole page.
  • Sitemaps. A site can list its URLs in an XML sitemap, giving each one an optional last-modified date. A crawler that reads the sitemap can skip pages whose dates have not changed. It can also discover new pages that have no links yet, as the deep web describes.
  • Notifications. Some sites announce changes instead of waiting to be checked. RSS and Atom feeds list recent updates, and protocols such as IndexNow let a site notify participating search engines when a URL changes.

A conditional request does not change the freshness arithmetic, since the crawler must still ask. It does make each check of an unchanged page nearly free, so a crawler can afford to check more often. Each of these mechanisms depends on the site's cooperation and honesty. A server that sends a fresh Last-Modified date on every request, or none, gives the crawler no help. The crawler must then fetch the page and compare the content itself, as monitoring websites does.

The numbers in this article are computed by tools/experiments/crawling/freshness_math.py in the site repository.

Worked problems

The course text has no exercises on freshness, so these problems are posed on the formulas of this article. Each exercises one result, and the numbers are checked in freshness_math.py.

Problem 1 (freshness and age of one page). A page changes twice a day on average and is visited every 6 hours. Find its average freshness and average age.

Here $\lambda = 2$ per day and $I = 0.25$ days, so $r = \lambda I = 0.5$ changes are expected between visits. The freshness is

$$\bar{F} = \frac{1 - e^{-0.5}}{0.5} = \frac{1 - 0.6065}{0.5} = 0.787.$$

For the age, $1/r = 2$ and $(1 - e^{-r})/r^2 = 0.3935/0.25 = 1.5739$, so

$$\bar{A} = I\left(\frac{1}{2} - \frac{1}{r} + \frac{1 - e^{-r}}{r^2}\right) = 0.25\,(0.5 - 2 + 1.5739) = 0.25 \times 0.0739 = 0.0185 \text{ days},$$

which is 0.44 hours, about 27 minutes. The copy is fresh 78.7 percent of the time. The freshness is the same as for the page of the table that changes once a day and is visited twice a day, since both have $r = 0.5$. The age is half of that page's 0.9 hours, because the interval $I$ multiplies the age formula and is half as long.

Problem 2 (the visit rate for a target freshness). How often must a page that changes once a day be visited to be fresh 90 percent of the time?

We need $r$ with $(1 - e^{-r})/r = 0.9$. The equation has no closed-form solution, but it has exactly one root, since $\bar{F}(r)$ falls steadily from 1 as $r$ grows. A first guess comes from the series $e^{-r} = 1 - r + r^2/2 - \cdots$, which gives $\bar{F}(r) \approx 1 - r/2$ for small $r$ and so $r \approx 0.2$. That guess gives $\bar{F}(0.2) = 0.9063$, slightly too fresh, so the root is a little larger. Solving numerically gives $r = 0.215$. The page must be visited $1/r = 4.66$ times for every change, that is 4.66 times a day, or about every 5 hours and 9 minutes. Compare the 2.15 visits per change that 80 percent needed: the last ten points of freshness more than double the cost.

Problem 3 (three pages, one of them fast). Three pages change 1, 2 and 10 times a day, and the crawler has 3 visits a day in total. Find the allocation that maximizes mean freshness, and compare it with the uniform and proportional ones.

The Lagrange condition asks for a constant $\mu$ with $\partial\bar{F}/\partial f = \mu$ for every page that is visited, and a page is skipped when its $1/\lambda$ is below $\mu$. The marginal value of a first visit is $1$, $0.5$ and $0.1$ for the three pages. Solving numerically for the $\mu$ at which the visit rates add up to 3 gives $\mu = 0.1706$. That is above $0.1$, so the page that changes 10 times a day is skipped, and the other two share the budget:

Change rate (per day) 1 2 10 Mean freshness
Optimal visits 1.348 1.652 0
Freshness under the optimum 0.706 0.580 0 0.429
Freshness under uniform visits (1 each) 0.632 0.432 0.100 0.388
Proportional visits 0.231 0.462 2.308
Freshness under proportional visits 0.228 0.228 0.228 0.228

As a check on the optimum, the marginal value $\partial\bar{F}/\partial f$ is $0.1706$ at both visited pages. Under uniform visits the fast page's copy is fresh a tenth of the time, which costs a third of the budget. The optimum gives up that tenth and gains more on the other two pages. The proportional policy gives every page $r = 13/3$ and the same freshness, $(1 - e^{-13/3})/(13/3) = 0.228$. It spends 2.3 of the 3 visits on the page that cannot be kept fresh, and it is the worst of the three by a wide margin.

Problem 4 (estimating a change rate). A page is visited once a day for 30 days, and a change is detected on 12 of the visits. Estimate its change rate.

The naive estimate is $X/(nI) = 12/30 = 0.4$ changes a day. The estimate from the Poisson model is

$$\hat{\lambda} = -\ln\left(1 - \frac{12}{30}\right) = -\ln 0.6 = 0.511 \text{ changes a day},$$

about 28 percent higher, because some of the 12 days with a change had more than one. With 0.5 added inside the logarithm, the form usually given, the estimate is $-\ln(18.5/30.5) = 0.500$. The two corrected values are close because $X$ is far from $n$. They would differ sharply for a page that changed on 29 or 30 of the 30 days.

What we have learned

Under the Poisson model, average freshness depends only on $r$, the expected changes between visits, and a page visited as often as it changes is fresh 63.2 percent of the time. Proportional visits lose to uniform ones, 0.632 against 0.685 for the two pages. The best division equalizes the marginal value of a visit and skips pages that change too fast to keep. The change rate itself is estimated from the fraction of visits that find a change, as $-\ln(1 - X/n)/I$.

All of this keeps current the pages a crawler already knows. The deep web turns to the pages that no link leads to, and to how a crawler can reach some of them.

References

  • Cho, J., and Garcia-Molina, H. (2000a). The evolution of the web and implications for an incremental crawler. In Proceedings of VLDB 2000, 200–209. record
  • Cho, J., and Garcia-Molina, H. (2000b). Synchronizing a database to improve freshness. In Proceedings of ACM SIGMOD 2000, 117–128. record
  • Cho, J., and Garcia-Molina, H. (2003a). Effective page refresh policies for web crawlers. ACM Transactions on Database Systems, 28(4), 390–426. record
  • Cho, J., and Garcia-Molina, H. (2003b). Estimating frequency of change. ACM Transactions on Internet Technology, 3(3), 256–290. record · 2 pages
  • Fetterly, D., Manasse, M., Najork, M., and Wiener, J. L. (2003). A large-scale study of the evolution of web pages. In Proceedings of WWW 2003, 669–678. record
  • Fielding, R., Nottingham, M., and Reschke, J. (2022). HTTP Semantics. RFC 9110, Internet Engineering Task Force. record · 2 pages
  • Manning, C. D., Raghavan, P., and Schütze, H. (2008). Introduction to Information Retrieval, section 20.1. Cambridge University Press. record · 102 pages

Reviewed: verified, 16 Nov 2026 · checked against sources, 23 Nov 2026 · citations checked, 16 Nov 2026 · editorial review, 23 Nov 2026 · 10 revisions