'Populates the internal plugin cache of each placeholder
in the given page if the placeholder has not been
previously cached.'

def _preload_placeholders_for_page(self, page, slots=None, inherit=False):

    from cms.utils.plugins import assign_plugins
    site_id = page.site_id
    if slots:
        placeholders = page.get_placeholders().filter(slot__in=slots)
    else:
        placeholders = page.rescan_placeholders().values()
    if inherit:
        slots_w_inheritance = [pl.slot for pl in placeholders]
    elif (not self.toolbar.edit_mode):
        slots_w_inheritance = [pl.slot for pl in page.get_declared_placeholders() if pl.inherit]
    else:
        slots_w_inheritance = []
    if self.placeholder_cache_is_enabled():
        _cached_content = self._get_cached_placeholder_content
        placeholders_to_fetch = [placeholder for placeholder in placeholders if (_cached_content(placeholder, site_id, self.request_language) == None)]
    else:
        placeholders_to_fetch = placeholders
    if placeholders_to_fetch:
        assign_plugins(request=self.request, placeholders=placeholders_to_fetch, template=page.get_template(), lang=self.request_language, is_fallback=inherit)
    placeholders_to_inherit = [pl.slot for pl in placeholders if ((not getattr(pl, '_plugins_cache', None)) and (pl.slot in slots_w_inheritance))]
    if (placeholders_to_inherit and page.parent_id):
        self._preload_placeholders_for_page(page=page.parent, slots=placeholders_to_inherit, inherit=True)
    page_placeholder_cache = {}
    for placeholder in placeholders:
        placeholder.page = page
        page_placeholder_cache[placeholder.slot] = placeholder
    self._placeholders_by_page_cache[page.pk] = page_placeholder_cache
