$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>uploads - Storing WordPress Media Library Uploaded files onto a separate domain|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

uploads - Storing WordPress Media Library Uploaded files onto a separate domain

matteradmin9PV0评论

We are looking forward to offload assets from our website (60GB onto a 8TB/mo accessed website), to a separate webserver that will be there only for serving images from a separate domain.

I know that I can apply filters to match /wp-content/uploads and rewrite these URLs in order to point at the new domain, but I have no way to have the Media Library Uploader to upload files straight to the new server.

Of course, I can provide SSH/Rsync and relative access between two servers. There are a few plugins that do the same for Buckets like AWS/Google Cloud and they do take care of removing the file locally, but the comparison of the services' price between an owned machine and these services showed big difference, so we ended up in developing our own solution.

Can anyone advise on how I can have Media Uploader to work with a different host? I thought that this was already implemented using a defined constant in wp-config, but thats untrue.

We are looking forward to offload assets from our website (60GB onto a 8TB/mo accessed website), to a separate webserver that will be there only for serving images from a separate domain.

I know that I can apply filters to match /wp-content/uploads and rewrite these URLs in order to point at the new domain, but I have no way to have the Media Library Uploader to upload files straight to the new server.

Of course, I can provide SSH/Rsync and relative access between two servers. There are a few plugins that do the same for Buckets like AWS/Google Cloud and they do take care of removing the file locally, but the comparison of the services' price between an owned machine and these services showed big difference, so we ended up in developing our own solution.

Can anyone advise on how I can have Media Uploader to work with a different host? I thought that this was already implemented using a defined constant in wp-config, but thats untrue.

Share Improve this question asked Jan 9, 2019 at 14:51 John GrecoJohn Greco 51 silver badge5 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 2

You should not remove the media from you server. Media is part of yout content and it makes no sense to have your content split over several servers. (from technical practical POV your idea will prevent any automated media transformation like new sizes from being done).

What you should do is to create your own "lite CDN" which is actually just a sort of caching proxy for the media related URLs.

(side note: you can rarely re-invent a wheel for your car which is cheaper than a wheel you can buy in a shop)

Post a comment

comment list (0)

  1. No comments so far