Returns a :class:`CacheRegion <dogpile.cache.region.CacheRegion>` based on settings.

        * Firstly, a backend is selected.
          The default is :class:`NullBackend <dogpile.cache.backends.null.NullBackend`.
        * Secondly, arguments for the backends are generated.
          The arguments can be passed as a dict to the setting or as a json string.
          If the arguments aren't a dict or aren't convertible to a dict, :class:`ArcaMisconfigured` is raised.
        * Lastly, the cache is tested if it works

        All errors can be suppressed by the ``ignore_cache_errors`` setting.

        :raise ModuleNotFoundError: In case dogpile has trouble importing the library needed for a backend.
        :raise ArcaMisconfigured: In case the cache is misconfigured in any way or the cache doesn't work.

def make_region(self) -> CacheRegion:
        """
        Returns a :class:`CacheRegion <dogpile.cache.region.CacheRegion>` based on settings.

        * Firstly, a backend is selected.
          The default is :class:`NullBackend <dogpile.cache.backends.null.NullBackend`.
        * Secondly, arguments for the backends are generated.
          The arguments can be passed as a dict to the setting or as a json string.
          If the arguments aren't a dict or aren't convertible to a dict, :class:`ArcaMisconfigured` is raised.
        * Lastly, the cache is tested if it works

        All errors can be suppressed by the ``ignore_cache_errors`` setting.

        :raise ModuleNotFoundError: In case dogpile has trouble importing the library needed for a backend.
        :raise ArcaMisconfigured: In case the cache is misconfigured in any way or the cache doesn't work.
        """
        arguments = self.get_setting("cache_backend_arguments", None)

        def null_cache():
            return make_region().configure(
                "dogpile.cache.null"
            )

        if isinstance(arguments, str) and arguments:
            try:
                arguments = json.loads(arguments)
            except ValueError:
                if self.ignore_cache_errors:
                    return null_cache()
                raise ArcaMisconfigured("Cache backend arguments couldn't be converted to a dictionary.")

        cache_backend = self.get_setting("cache_backend", "dogpile.cache.null")

        if cache_backend == "dogpile.cache.dbm":
            # if a file backend is used, create the folder for the file (if it doesn't exist)
            if isinstance(arguments, dict) and "filename" in arguments:
                Path(arguments["filename"]).parent.mkdir(parents=True, exist_ok=True)

        try:
            region = make_region().configure(
                cache_backend,
                expiration_time=self.get_setting("cache_expiration_time", None),
                arguments=arguments
            )
            region.set("last_arca_run", datetime.now().isoformat())
        except ModuleNotFoundError:
            if self.ignore_cache_errors:
                return null_cache()
            raise ModuleNotFoundError("Cache backend cannot load a required library.")
        except Exception:
            if self.ignore_cache_errors:
                return null_cache()
            raise ArcaMisconfigured("The provided cache is not working - most likely misconfigured.")

        return region