Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Publisher preview is slow

Status Resolved
Add-on / Version Publisher Lite 2.6
Severity
EE Version 3.5.4

KeesTM

Jul 12, 2017

Description:
When I save an entry in the backend, it takes at least 1 full minute to save & preview. Is there any way to reduce this execution time?

Detailed steps to reproduce the issue:
1. Go to edit channel (DOT detailpagina)
2. Change block
3. Save & preview

#1

BoldMinded (Brian)

It looks like you have a ton of pages in your Structure module. This build should help make it faster…

#2

BoldMinded (Brian)

Comment has been marked private.

#3

BoldMinded (Brian)

Comment has been marked private.

#4

Est Digital

I’ve downloaded your build and replaced my current Publisher files with the files from this build, but it didn’t improve the speed. Should I completely re-install?

#5

BoldMinded (Brian)

No you shouldn’t need to re-install.

#6

BoldMinded (Brian)

It looks like you have the full Publisher installed, not Publisher Lite, which is what you have a license for. Grab the 2nd link I sent, not the first.

#7

BoldMinded (Brian)

What channel entry are you editing to produce a 1 minute save/load time? I just saved “Taaltrainingen Taaladviesdienst” and it took about 20 seconds. Quicker would be ideal, but you have a massive site with a lot of pages. Publisher has to validate all of the pages when it saves an entry to check to see if the entry moved in the site tree or if a url was changed.

#8

BoldMinded (Brian)

Comment has been marked private.

#9

Est Digital

I’m editing Dot detailpagina: entry ID 14468. It takes very long to save & preview, but it explains that Publisher has to validate all pages first. Maybe it just won’t get any quicker than this.

Let me explain: We are currently updating 5 websites, which require preview functionality, from EE2 to EE3. In EE2 we used to have EP Better Workflow installed to handle the preview functionality, but now we’re going to have to use Publisher instead. So for now we’re going to see if this works for us, and if it does we will purchase the licences.

Thank you for your help so far!

#10

BoldMinded (Brian)

I edited 14468 and it took 22 seconds to save. The latest build should make page saving faster. I made an optimization that reduced another customer’s page save time from ~20 seconds to about 10. I’ll continue to look at making optimizations to make it faster, but its going to be awhile before I can deliver anything else, so keep an out out for future updates. Its the best I can do right now, sorry.

#11

BoldMinded (Brian)

Comment has been marked private.

#12

Est Digital

I fixed the 404s but it didn’t improve the speed much. I’m going to double check everything to see if I missed anything to speed things up. Thank you for your help!

#13

Est Digital

Just 1 more question - You said: “Publisher has to validate all of the pages when it saves an entry to check to see if the entry moved in the site tree or if a url was changed.”.

I can find this functionality in the code and write an exception so Publisher won’t do this on entry save, because this drastically increases the speed and I am wondering if this is really nessecary on entry save. Can you explain what the risk would be if I’d do this?

#14

BoldMinded (Brian)

It depends on what your change is. Would you mind sharing it? One thought I had was to skip the page validation if the URL Title and Structure URL Title fields do not change.

#15

Est Digital

in publisher_site_pages.pgp line 636 I added this condition:

if(!isset($_REQUEST["submit"])){
                 $this->save_structure($this->get_core_pages(true));
    }

This speeds up the preview functionality, and everything seems to work fine, but I’m not sure about the risks..

#16

BoldMinded (Brian)

The preview isn’t part of the saving process. The entry is saved (the slow part), then the page is reloaded to display the modal containing the preview. So adding a check like this only prevents the pages from ever getting saved, which would be bad. The conditional on line 635 may also need to check the actual submitted Structure URL Title and compare it to the one that exists, e.g.

if (!in_array($pageUri, $sitePages) || $pageUri != $pagesUris[$entryId] ||$pageTemplates[$entryId] != $templateId) {
                $this->save_structure($this->get_core_pages(true)); 
}

This is untested, but that is the basic idea of what I will try testing next week.

#17

BoldMinded (Brian)

Closing this ticket since the next release 2.6.1 will have this included

Login to reply