Automattic / Automattic/wp-super-cache
Super Cache: Predictive search images are not using the CDN URL
- Dominant language
- PHP
- Stars
- 436
- Forks
- 130
- Avg merge
- 15h 11m
- Merged PRs (30d)
- 10
Description
### Impacted plugin
Super Cache
### Quick summary
I use a CDN on my website (https://www.underthecover.pt/) and all of the images are provided by the CDN service (I use WP Super Cache to implement it), but when typing a product name on the search bar, all of the image products of the predictive search are sourced directly from the root “wp-content/uploads” instead of the CDN, which is overloading the server. I have questioned the developers of my current theme (Savoy on ThemeForest) and they replied the following:
"The image URLs in the search-suggestions data are generated with the standard "wp_get_attachment_image_src()" WP function, however the data is generated via an Ajax call so that could be why the "WP Super Cache" plugin isn't changing them.
I'm not exactly sure how the WP Super Cache plugin is changing the image URLs, so it would be best to contact their support in this case and explain what I wrote above, then get back to me if there's something I can do to help solve this."
### Steps to reproduce
1. Start at https://www.underthecover.pt/
2. Click the search icon on the top bar (only on desktop)
3. Begin to type a product name
4. See the origin path of the predictive search product image
### A clear and concise description of what you expected to happen.
The images of the products that show up on the predictive search should be sourced from the CDN, not from the root “wp-content/uploads”
### What actually happened
Product's predictive search images are sourced directly from “wp-content/uploads” instead of the CDN URL
### Impact
All
### Available workarounds?
No but the platform is still usable
### Platform (Simple and/or Atomic)
_No response_
### Logs or notes
_No response_
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the issue from the reported site by opening the desktop search and entering a product name. Inspect the predictive-search Ajax response and trace the use of wp_get_attachment_image_src(), then compare it with WP Super Cache's CDN URL rewriting. Done means the returned product-image URLs use the configured CDN rather than wp-content/uploads.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100