-(require 'gnus)
-
-(defvar gnus-cache-directory
- (nnheader-concat gnus-directory "cache/")
- "*The directory where cached articles will be stored.")
-
-(defvar gnus-cache-active-file
- (concat (file-name-as-directory gnus-cache-directory) "active")
- "*The cache active file.")
+(eval-when-compile
+ (if (not (fboundp 'gnus-agent-load-alist))
+ (defun gnus-agent-load-alist (group)))
+ (require 'gnus-sum))
+
+(defcustom gnus-cache-active-file
+ (expand-file-name "active" gnus-cache-directory)
+ "*The cache active file."
+ :group 'gnus-cache
+ :type 'file)
+
+(defcustom gnus-cache-enter-articles '(ticked dormant)
+ "Classes of articles to enter into the cache."
+ :group 'gnus-cache
+ :type '(set (const ticked) (const dormant) (const unread) (const read)))
+
+(defcustom gnus-cache-remove-articles '(read)
+ "Classes of articles to remove from the cache."
+ :group 'gnus-cache
+ :type '(set (const ticked) (const dormant) (const unread) (const read)))
+
+(defcustom gnus-cacheable-groups nil
+ "*Groups that match this regexp will be cached.
+
+If you only want to cache your nntp groups, you could set this
+variable to \"^nntp\".
+
+If a group matches both gnus-cacheable-groups and gnus-uncacheable-groups
+it's not cached."
+ :group 'gnus-cache
+ :type '(choice (const :tag "off" nil)
+ regexp))
+
+(defcustom gnus-uncacheable-groups nil
+ "*Groups that match this regexp will not be cached.