Index: squid/src/cf.data.pre diff -c squid/src/cf.data.pre:1.245.2.52 squid/src/cf.data.pre:1.245.2.53 *** squid/src/cf.data.pre:1.245.2.52 Thu Nov 6 07:54:20 2003 --- squid/src/cf.data.pre Fri Nov 28 12:14:31 2003 *************** *** 1733,1739 **** LOC: Config.positiveDnsTtl DEFAULT: 6 hours DOC_START ! Time-to-Live (TTL) for positive caching of successful DNS lookups. Default is 6 hours (360 minutes). If you want to minimize the use of Squid's ipcache, set this to 1, not 0. DOC_END --- 1733,1739 ---- LOC: Config.positiveDnsTtl DEFAULT: 6 hours DOC_START ! Upper limit on how long Squid will cache positive DNS responses. Default is 6 hours (360 minutes). If you want to minimize the use of Squid's ipcache, set this to 1, not 0. DOC_END Index: squid/src/fqdncache.c diff -c squid/src/fqdncache.c:1.149.2.1 squid/src/fqdncache.c:1.149.2.2 *** squid/src/fqdncache.c:1.149.2.1 Sat Oct 11 16:32:31 2003 --- squid/src/fqdncache.c Fri Nov 28 12:14:32 2003 *************** *** 260,266 **** } f.flags.negcached = 0; ttl = atoi(token); ! if (ttl > 0) f.expires = squid_curtime + ttl; else f.expires = squid_curtime + Config.positiveDnsTtl; --- 260,266 ---- } f.flags.negcached = 0; ttl = atoi(token); ! if (ttl > 0 && ttl < Config.positiveDnsTtl) f.expires = squid_curtime + ttl; else f.expires = squid_curtime + Config.positiveDnsTtl; *************** *** 303,309 **** f.flags.negcached = 0; f.names[0] = xstrdup(answers[k].rdata); f.name_count = 1; ! f.expires = squid_curtime + answers[k].ttl; return &f; } debug(35, 1) ("fqdncacheParse: No PTR record\n"); --- 303,312 ---- f.flags.negcached = 0; f.names[0] = xstrdup(answers[k].rdata); f.name_count = 1; ! if (answers[k].ttl < Config.positiveDnsTtl) ! f.expires = squid_curtime + answers[k].ttl; ! else ! f.expires = squid_curtime + Config.positiveDnsTtl; return &f; } debug(35, 1) ("fqdncacheParse: No PTR record\n"); Index: squid/src/ipcache.c diff -c squid/src/ipcache.c:1.236 squid/src/ipcache.c:1.236.2.1 *** squid/src/ipcache.c:1.236 Tue Nov 13 15:16:24 2001 --- squid/src/ipcache.c Fri Nov 28 12:14:32 2003 *************** *** 275,281 **** } i.flags.negcached = 0; ttl = atoi(token); ! if (ttl > 0) i.expires = squid_curtime + ttl; else i.expires = squid_curtime + Config.positiveDnsTtl; --- 275,281 ---- } i.flags.negcached = 0; ttl = atoi(token); ! if (ttl > 0 && ttl < Config.positiveDnsTtl) i.expires = squid_curtime + ttl; else i.expires = squid_curtime + Config.positiveDnsTtl; *************** *** 344,351 **** continue; if (answers[k].class != RFC1035_CLASS_IN) continue; ! if (j == 0) ! i.expires = squid_curtime + answers[k].ttl; assert(answers[k].rdlength == 4); xmemcpy(&i.addrs.in_addrs[j++], answers[k].rdata, 4); debug(14, 3) ("ipcacheParse: #%d %s\n", --- 344,355 ---- continue; if (answers[k].class != RFC1035_CLASS_IN) continue; ! if (j == 0) { ! if (answers[k].ttl < Config.positiveDnsTtl) ! i.expires = squid_curtime + answers[k].ttl; ! else ! i.expires = squid_curtime + Config.positiveDnsTtl; ! } assert(answers[k].rdlength == 4); xmemcpy(&i.addrs.in_addrs[j++], answers[k].rdata, 4); debug(14, 3) ("ipcacheParse: #%d %s\n",