Skip to content
This repository has been archived by the owner on Apr 22, 2021. It is now read-only.

Performance Improvement on Original Domains #60

Open
vkathirvel opened this issue Aug 19, 2019 · 6 comments
Open

Performance Improvement on Original Domains #60

vkathirvel opened this issue Aug 19, 2019 · 6 comments

Comments

@vkathirvel
Copy link

vkathirvel commented Aug 19, 2019

Would it make sense to not process the plugin if the request was for the original domain? I notice that canonicals are inserted for original domain too - meaning the plugin is processing original domain pages as well.

private function __construct()
{
    $this->initAttributes();

// Adding this could skip original domain processing, not?
if($this->domain == $this->originalDomain) {
return;
}
$this->hookActions();
$this->hookFilters();
$this->hookShortcodes();

    new MultipleDomainSettings($this);
}
@vkathirvel
Copy link
Author

The above is a rough working Ideally the code needs to be optimised when it comes to delivering the Original Domain.

@straube
Copy link
Owner

straube commented Aug 20, 2019

Hey @vkathirvel. Thanks for the suggestion. Yet, the change is not that simple. E.g. if one has a link inside a post pointing to https://otherdomain.com and they're accessing the page from https://originaldomain.com, that link won't get replaced. Clicking on it would take the user to a different domain. Does it make sense?

In any way, if you want to put some time on improving these checks, feel free to open a PR. I'll be happy to review it.

@vkathirvel
Copy link
Author

Thanks @straube
I've been playing around with the tweaks and I figured it is more complex than I thought :)
I'll see if I can improve the code. Thanks.

@straube
Copy link
Owner

straube commented Oct 15, 2019

Hey @vkathirvel. While revisiting this issue I was thinking if an option would be useful here. We could add a new option to the plugin settings that allow site admins to disable the rewrite processing for the original domain. If they think it's safe to do so, i.e. everything from user-created content to uploads is on the main domain, they could enable this option. In this case, it'd default to processing on the original domain. Does it make sense?

@harryqt
Copy link

harryqt commented Dec 24, 2019

We could add a new option to the plugin settings that allow site admins to disable the rewrite processing for the original domain.

Not going to work when cache plugin exists because the pages will be cached.

@straube
Copy link
Owner

straube commented Jan 9, 2020

@Dibbyo456 If the site admin disables the rewriting, then purges the cache, isn't it supposed to work? Next time the page is cached, it'll use the original content with no rewriting applied.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants