codesandbox / codesandbox/codesandbox-client
Embed options on Medium / Embedly are incorrectly cached
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 13.6k
- Forks
- 2.4k
- Avg merge
- 6d 19h
- Merged PRs (30d)
- 2
Description
🐛 bug report
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project
adheres to. - I have searched the issue tracker for an issue that matches the one I want
to file, without success.
Description of the problem
This is a follow-up of the problem described in #6838. I am not sure if this issue is identical or just very similar. Unfortunately my problem seems to persists even though #6838 is closed.
The first time I embed a sandbox with options on Medium, these options are correctly reflected in the embed. However, this no longer works if I embed a second link to the same sandbox, but with different options. A cached embed is displayed, using the old query parameters.
There is no caching issue when visiting the embed link directly (bypassing Embedly). The codesandbox.io/oembed endpoint also doesn't seem to have this problem. I suspect that Embedly strips down all sandbox URLs to a version without query parameters (as this comment had already pointed out) and uses that as some sort of caching key.
Because it's likely (though I'm not 100% sure) this issue is on Embedly's side, I have contacted their customer support about it. It seems like this did seem to help with #6838, so I'm hoping they can again provide a solution. I will let you know if I get a response.
How has this issue affected you? What are you trying to accomplish?
I am trying to embed the same Sandbox in Medium article multiple times, where each embed displays a different file. This issue makes that impossible, as changes to the module parameter are ignored. Instead, all embeds in the article will display the same module.
To Reproduce
- Generate an embed link with custom options
- Paste the link in the Medium editor or submit it in Embedly's Embed Code Generator tool
- Change one of the URL parameters of the embed link
- Repeat step 2 with the new link
Link to sandbox: link
Note: this is the sandbox I provided to Embedly support, but this issue seems to reproduce with any sandbox.
Your Environment
| Software | Name/Version |
|---|---|
| Сodesandbox | |
| Browser | Firefox 108 |
| Operating System | macOS (Catalina) |
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the two sandbox embeds through Medium or Embedly, using the linked sandbox and changing a URL option such as module. Compare the direct codesandbox.io/oembed response with Embedly's result; done means distinct query parameters produce distinct embeds, or the issue is confirmed to require Embedly rather than this repository.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, web-dev
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100