Changes

Jump to: navigation, search

Browser History:Redirects

1,524 bytes added, 23:30, 11 December 2005
Bookmark Queries
First, let us discard one case: when the page in question redirects to a bookmarked page. In this case, the user has specifically bookmarked the destination page and probably does not consider the source page to be the same. Furthermore, the source page's redirect may have changed, so the equivalence of the URLs may not even be true any more.
 
Therefore, the question becomes: "has the page in question been redirected from any bookmarked URL?" This question can be answered by querying history, although the possibility of multiple redirects makes this more difficult because we may have to execute multiple statements.
 
This approach could cause problems if the user clears their history. For example, if they create a bookmark for "google.com", clear their history (removing all redirect information) and manually type in "www.google.com" the equivalence will not be detected.
 
This approach is also very inefficient. If we wanted to mark all bookmarked items in a history view, we'll have to execute at least one query per row just to determine if it has been bookmarked. A simple optimization would be to add a boolean column in history that indicates whether this URL has <i>ever</i> been a redirect destination. This way, we can quickly discard most history items, and only do these queries for the minority of pages that have been redirected.
 
An additional level of optimization would include the URL of the redirect source in the history column. If we ever need to add another redirect source and the redirect column is already full and does not match, we can specify some known string that indicates there is more than one source. This saves a little bit of time since in the next-most-common case where there is only one redirect source can use a simple query over history rather than a join over all visits. This optimization may or may not be worth it.
202
edits

Navigation menu