I have a feature on my website where users can add an unlimited number of TinyMCE editors, each wrapped in some div elements.
The HTML code is stored in a Groovy Server Pages (GSP) template because it's lengthy and I didn't want to clutter up the JavaScript. Whenever a user clicks "add editor," an AJAX request is sent to the server with a unique ID as the parameter. The controller then renders the template with properly named elements based on the new ID, which is then appended to the page using JavaScript.
While I find this solution elegant, I'm concerned about the performance impact of multiple AJAX calls being made for each new editor added to the page, even though the code is essentially the same except for the element IDs.
Will this approach affect the performance? Is the GSP template cached after the first call? Thanks