diff -u squid-2.5.STABLE2/src/cache_cf.c squid-2.5.STABLE2/src/cache_cf.c
--- squid-2.5.STABLE2/src/cache_cf.c	2003-02-06 08:01:07.000000000 +0300
+++ squid-2.5.STABLE2/src/cache_cf.c	2004-04-02 21:50:54.000000000 +0400
@@ -1797,6 +1797,8 @@
 	    storeAppendPrintf(entry, " reload-into-ims");
 	if (head->flags.ignore_reload)
 	    storeAppendPrintf(entry, " ignore-reload");
+	if (head->flags.cache_all)
+	    storeAppendPrintf(entry, " cache-all");
 #endif
 	storeAppendPrintf(entry, "\n");
 	head = head->next;
@@ -1816,6 +1818,7 @@
     int override_lastmod = 0;
     int reload_into_ims = 0;
     int ignore_reload = 0;
+    int cache_all = 0;
 #endif
     int i;
     refresh_t *t;
@@ -1847,6 +1850,8 @@
 	    override_expire = 1;
 	else if (!strcmp(token, "override-lastmod"))
 	    override_lastmod = 1;
+	else if (!strcmp(token, "cache-all"))
+	    cache_all = 1;
 	else if (!strcmp(token, "reload-into-ims")) {
 	    reload_into_ims = 1;
 	    refresh_nocache_hack = 1;
@@ -1888,6 +1893,8 @@
 	t->flags.reload_into_ims = 1;
     if (ignore_reload)
 	t->flags.ignore_reload = 1;
+    if (cache_all)
+	t->flags.cache_all = 1;
 #endif
     t->next = NULL;
     while (*head)
diff -u squid-2.5.STABLE2/src/cf.data.pre squid-2.5.STABLE2/src/cf.data.pre
--- squid-2.5.STABLE2/src/cf.data.pre	2003-02-05 08:27:50.000000000 +0300
+++ squid-2.5.STABLE2/src/cf.data.pre	2004-04-02 21:50:54.000000000 +0400
@@ -1569,6 +1569,7 @@
 		 override-lastmod
 		 reload-into-ims
 		 ignore-reload
+		 cache-all
 
 		override-expire enforces min age even if the server
 		sent a Expires: header. Doing this VIOLATES the HTTP
@@ -1587,6 +1588,13 @@
 		header. Doing this VIOLATES the HTTP standard. Enabling
 		this feature could make you liable for problems which
 		it causes.
+
+		cache-all makes Squid cache virtually everything, ignoring
+		"Cache-Control" and "Pragma: no-cache" server headers and
+		caching objects without either of "Last-Modified", "Date"
+		and "Expires" headers. This is intended primarily for using
+		Squid as offline cache and may cause some unexpected
+		problems (use at your own risk).
 		
 	Basically a cached object is:
 
diff -u squid-2.5.STABLE2/src/http.c squid-2.5.STABLE2/src/http.c
--- squid-2.5.STABLE2/src/http.c	2002-09-08 02:52:10.000000000 +0400
+++ squid-2.5.STABLE2/src/http.c	2004-04-02 21:50:54.000000000 +0400
@@ -53,6 +53,7 @@
 static void httpMakePrivate(StoreEntry *);
 static void httpMakePublic(StoreEntry *);
 static int httpCachableReply(HttpStateData *);
+static int httpAllCachableReply(int, HttpReply *);
 static void httpMaybeRemovePublic(StoreEntry *, http_status);
 
 static void
@@ -218,14 +219,16 @@
 {
     HttpReply *rep = httpState->entry->mem_obj->reply;
     HttpHeader *hdr = &rep->header;
+    const refresh_t *R = refreshLimits(httpState->entry->mem_obj->url);
+    const int cache_all = R ? (R->flags.cache_all) : 0;
     const int cc_mask = (rep->cache_control) ? rep->cache_control->mask : 0;
     const char *v;
     if (EBIT_TEST(cc_mask, CC_PRIVATE))
-	return 0;
+	return httpAllCachableReply(cache_all, rep);
     if (EBIT_TEST(cc_mask, CC_NO_CACHE))
-	return 0;
+	return httpAllCachableReply(cache_all, rep);
     if (EBIT_TEST(cc_mask, CC_NO_STORE))
-	return 0;
+	return httpAllCachableReply(cache_all, rep);
     if (httpState->request->flags.auth) {
 	/*
 	 * Responses to requests with authorization may be cached
@@ -233,7 +236,7 @@
 	 * RFC 2068, sec 14.9.4
 	 */
 	if (!EBIT_TEST(cc_mask, CC_PUBLIC))
-	    return 0;
+	    return httpAllCachableReply(cache_all, rep);
     }
     /* Pragma: no-cache in _replies_ is not documented in HTTP,
      * but servers like "Active Imaging Webcast/2.0" sure do use it */
@@ -242,7 +245,7 @@
 	const int no_cache = strListIsMember(&s, "no-cache", ',');
 	stringClean(&s);
 	if (no_cache)
-	    return 0;
+	    return httpAllCachableReply(cache_all, rep);
     }
     /*
      * The "multipart/x-mixed-replace" content type is used for
@@ -251,7 +254,7 @@
      */
     if ((v = httpHeaderGetStr(hdr, HDR_CONTENT_TYPE)))
 	if (!strncasecmp(v, "multipart/x-mixed-replace", 25))
-	    return 0;
+	    return httpAllCachableReply(cache_all, rep);
     switch (httpState->entry->mem_obj->reply->sline.status) {
 	/* Responses that are cacheable */
     case HTTP_OK:
@@ -264,7 +267,7 @@
 	 * unless we know how to refresh it.
 	 */
 	if (!refreshIsCachable(httpState->entry))
-	    return 0;
+	    return httpAllCachableReply(cache_all, rep);
 	/* don't cache objects from peers w/o LMT, Date, or Expires */
 	/* check that is it enough to check headers @?@ */
 	if (rep->date > -1)
@@ -277,7 +280,7 @@
 	else if (rep->expires > -1)
 	    return 1;
 	else
-	    return 0;
+	    return httpAllCachableReply(cache_all, rep);
 	/* NOTREACHED */
 	break;
 	/* Responses that only are cacheable if the server says so */
@@ -285,7 +288,7 @@
 	if (rep->expires > -1)
 	    return 1;
 	else
-	    return 0;
+	    return httpAllCachableReply(cache_all, rep);
 	/* NOTREACHED */
 	break;
 	/* Errors can be negatively cached */
@@ -319,6 +322,16 @@
     /* NOTREACHED */
 }
 
+int
+httpAllCachableReply(int cache_all, HttpReply *rep)
+{
+  if (cache_all) {
+    rep->expires = 0;
+    return 1;
+  }
+  return 0;
+}
+
 /*
  * For Vary, store the relevant request headers as 
  * virtual headers in the reply
--- squid-2.5.STABLE2/src/protos.h	2003-01-03 02:10:46.000000000 +0300
+++ squid-2.5.STABLE2/src/protos.h	2004-04-02 21:50:54.000000000 +0400
@@ -785,6 +785,7 @@
 extern int refreshCheckDigest(const StoreEntry *, time_t delta);
 extern time_t getMaxAge(const char *url);
 extern void refreshInit(void);
+extern const refresh_t *refreshLimits(const char *url);
 
 extern void serverConnectionsClose(void);
 extern void shut_down(int);
diff -u squid-2.5.STABLE2/src/refresh.c squid-2.5.STABLE2/src/refresh.c
--- squid-2.5.STABLE2/src/refresh.c	2002-07-18 13:22:17.000000000 +0400
+++ squid-2.5.STABLE2/src/refresh.c	2004-04-02 21:50:54.000000000 +0400
@@ -99,14 +99,13 @@
 #define REFRESH_DEFAULT_PCT	0.20
 #define REFRESH_DEFAULT_MAX	(time_t)259200
 
-static const refresh_t *refreshLimits(const char *);
 static const refresh_t *refreshUncompiledPattern(const char *);
 static OBJH refreshStats;
 static int refreshStaleness(const StoreEntry *, time_t, time_t, const refresh_t *, stale_flags *);
 
 static refresh_t DefaultRefresh;
 
-static const refresh_t *
+const refresh_t *
 refreshLimits(const char *url)
 {
     const refresh_t *R;
diff -u squid-2.5.STABLE2/src/structs.h squid-2.5.STABLE2/src/structs.h
--- squid-2.5.STABLE2/src/structs.h	2003-01-21 03:06:39.000000000 +0300
+++ squid-2.5.STABLE2/src/structs.h	2004-04-02 21:50:54.000000000 +0400
@@ -1683,6 +1683,7 @@
 	unsigned int override_lastmod:1;
 	unsigned int reload_into_ims:1;
 	unsigned int ignore_reload:1;
+	unsigned int cache_all:1;
 #endif
     } flags;
 };

