Closed MichelleBlanchette closed 1 year ago
The best part is that the code is more readable, uses the WordPress event system for third-party customization and intervention, and is 19 fewer lines. 👍
Oh, I just realized I could use server-side caching for this, too... 🤔
So I was working on caching the proxied response and making a different endpoint... Development was fine, but I really just don't feel good about doing my own server-side caching in the Request Token because I wouldn't actually respect the Cache-Control max-age time. Also, it's completely unnecessary when the user's web browser should already be properly handling the caching. So I will actually forego the caching part of issue #139 and simply leave it at the updated cURL process.
Took a few benchmarks for loading the proxied image. See table below of recorded loading times in seconds.
The benchmarks felt pretty inconsistent (probably since we're depending on a third-party server with variable traffic/resources). However, if anything,
wp_remote_get()
happened to have a lower average, median, and standard deviation. Could very well be random, though.