Cache sections rendered html for editor use #35650
leonardola
started this conversation in
Feature Request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Describe the Problem
Sections can be added to a page by using a template widget.
Screen.Recording.2026-04-30.at.11.47.20.mov
These kind of widgets only include a reference to a section instead of copying the whole code to the page. This is extremely useful for big pages. Making the editor use much less ram as the sections can't be directly edited. Meaning you have to open a separate editor to edit them.
This is all good but Elementor still re-renders the section html in the backend every time a page editor loads. Taking a really long time even though it does not change without editing the section itself.
Propose a Solution
As sections can't be edited directly in the page editor why not cache the html when the section gets saved making the whole page editor load much faster?
What I'm proposing is that we render the section html when it gets saved and save it to the database as a post meta ( something like
_elementor_rendered_html_cache).This way when a page loads instead of re-rendering the whole html we only load the html from the meta field saving lots of precious seconds on pages with tons of templates in them.
For instance I have a page editor that usually takes 30+ seconds to load meanwhile after implementing such cache strategy it only takes 1.2 seconds.
I'm open to discuss this further and even open a PR with a fix example if people think this makes sense.
If this can't be done because of backwards compatibility issues would it at least be possible to add hooks so 3rd party plugins could use them to implement the caching strategy on their side?
This could be achieved by adding a hook to the save section code and to the render template which would allow to pre-emptively return a rendered html.
Additional Context
How to simulate:
This proposal has nothing to do with front-end element cache it's meant to cache the section for editing purposes only.
Agreement
All reactions