def open_cache_biblio(dir, global: true)
      return nil if dir.nil?
      db = DbCache.new dir
      if File.exist? dir
        if global
          unless db.check_version?
            FileUtils.rm_rf(Dir.glob(dir + '/*'), secure: true)
            warn "Global cache version is obsolete and cleared."
          end
          db.set_version
        elsif db.check_version? then db
        else
          warn "Local cache version is obsolete."
          nil
        end
      else db.set_version
      end
    end
def open_cache_biblio(dir, global: true)
      return nil if dir.nil?
      db = DbCache.new dir
      if File.exist? dir
        if global
          unless db.check_version?
            FileUtils.rm_rf(Dir.glob(dir + '/*'), secure: true)
            warn "Global cache version is obsolete and cleared."
          end
          db.set_version
        elsif db.check_version? then db
        else
          warn "Local cache version is obsolete."
          nil
        end
      else db.set_version
      end
    end
if cached reference is undated, expire it after 60 days
 @param bib [Hash]
 @param year [String]
 def valid_bib_entry?(bib, year)
   bib&.is_a?(Hash) && bib&.has_key?("bib") && bib&.has_key?("fetched") &&
     (year || Date.today - bib["fetched"] < 60)
 end
 @param dir [String] DB directory
 @param global [TrueClass, FalseClass]
 @return [PStore]