When i understand it correct, the wpfc_buffer_callback_filter is what im looking for option #2?
Tobad the sites on the different domain use different title and something else.
Is it possible to separate the cache per domain?
/wp-content/cache/all will be to /wp-content/cache/[domain]/all ?
Or add a hook where i can set the cache dir?
thanks
yes, it is possible to separate the cache per domain. Have you tried using the plugin and have problems? Or do you just want preliminary information?
hi Emre Vona,
i have the plugin and looking for the information where/how i can do it.
-
This reply was modified 1 year, 4 months ago by stefanxyz.
you should try wp fastest cache. i guess it will work.
sure but its no default setting i think, the files goes to /wp-content/cache/all and are not separated by domain
Our plugin separates the cache per domain by default.
your sure? in my test i got the files from the .org domain supplied on the.store domain or do you speak about multi site? I dont use a multisite, i use multiple domains on the same site
I do not know what you are using but it may work. if it does not work, we can handle it.
how we can test it? i change the site onfly btw over the following filter
add_filter(‘content_url’, ‘fixUrl’); add_filter(‘option_siteurl’, ‘fixUrl’); add_filter(‘option_home’, ‘fixUrl’); add_filter(‘plugins_url’, ‘fixUrl’); add_filter(‘wp_get_attachment_url’, ‘fixUrl’); add_filter(‘get_the_guid’, ‘fixUrl’); add_filter(‘upload_dir’, ‘fixUrl’); add_filter(‘the_content’, ‘fixUrl’); add_filter(‘upload_dir’, ‘fixUploadDir’);
cache.php
$this->cacheFilePath = $this->getWpContentDir(“/cache/”.$type.”/”).$_SERVER[“REQUEST_URI”];
this should include $_SERVER['SERVER_NAME']
or a hashed version of after my first view
edit: works and create a own folder for every domain, would need only todo for the js/css
-
This reply was modified 1 year, 4 months ago by stefanxyz.
ahh nice i see, and now i understand you with its creates them by default, you check for multiple-domain/multiple-domain.php and is_multisite then use the hostname. Can i ask you to add in line 1150 a filter where i can force set the is multi domain without having the multiple-domain.php installed? I can edit it but after update i have to edit it again. thank you
sure but I need to know which method you are using. is there any tutorial which you have read about it?
i was looking for but dont find it again, was copy and paste from GitHub.
i use A records and all domain goes to my wordpress instance over IP, in my function.php i replace the domains in fixUrl over str_replace over the following filter:
add_filter(‘content_url’, ‘fixUrl’); add_filter(‘option_siteurl’, ‘fixUrl’); add_filter(‘option_home’, ‘fixUrl’); add_filter(‘plugins_url’, ‘fixUrl’); add_filter(‘wp_get_attachment_url’, ‘fixUrl’); add_filter(‘get_the_guid’, ‘fixUrl’); add_filter(‘upload_dir’, ‘fixUrl’); add_filter(‘the_content’, ‘fixUrl’); add_filter(‘upload_dir’, ‘fixUploadDir’);
<?phpclass rewrite{ function __construct() { add_filter('content_url', [$this, 'fixUrl']); add_filter('option_siteurl', [$this, 'fixUrl']); add_filter('option_home', [$this, 'fixUrl']); add_filter('plugins_url', [$this, 'fixUrl']); add_filter('wp_get_attachment_url', [$this, 'fixUrl']); add_filter('get_the_guid', [$this, 'fixUrl']); add_filter('upload_dir', [$this, 'fixUploaddir']); add_filter('the_content', [$this, 'fixUrl'], 20); add_filter('upload_dir', [$this, 'fixUploadDir']); } function fixUrl($url) { return str_replace($this->orginalDomain, $this->domain, $url); } function fixUploaddir($param) { $param['url'] = str_replace($this->orginalDomain, $this->domain, $param['url']); $param['baseurl'] = str_replace($this->orginalDomain, $this->domain, $param['baseurl']); return $param; }}$r = new rewrite();?>
or here on Pastebin https://pastebin.com/56RQP3NM
that is basically the magic. $this->orginalDomain is the domain from the config where the wp is installed, $this->domain is the wanted domain i want show.
-
This reply was modified 1 year, 4 months ago by stefanxyz.
-
This reply was modified 1 year, 4 months ago by stefanxyz.