def save(self, *args, **kwargs):
        """
        Overridden save method which updates the ``_cached_url`` attribute of
        this page and all subpages. Quite expensive when called with a page
        high up in the tree.
        """

        cached_page_urls = {}

        # determine own URL
        if self.override_url:
            self._cached_url = self.override_url
        elif self.is_root_node():
            self._cached_url = "/%s/" % self.slug
        else:
            self._cached_url = f"{self.parent._cached_url}{self.slug}/"

        cached_page_urls[self.id] = self._cached_url

        with transaction.atomic():
            super().save(*args, **kwargs)

            # If our cached URL changed we need to update all descendants to
            # reflect the changes. Since this is a very expensive operation
            # on large sites we'll check whether our _cached_url actually changed
            # or if the updates weren't navigation related:
            if self._cached_url != self._original_cached_url:
                pages = self.get_descendants().order_by("lft")

                for page in pages:
                    if page.override_url:
                        page._cached_url = page.override_url
                    else:
                        # cannot be root node by definition
                        page._cached_url = "{}{}/".format(
                            cached_page_urls[page.parent_id],
                            page.slug,
                        )

                    cached_page_urls[page.id] = page._cached_url
                    super(BasePage, page).save()  # do not recurse

        Overridden save method which updates the ``_cached_url`` attribute of
        this page and all subpages. Quite expensive when called with a page
        high up in the tree.
        
feincms/module/page/models.py