Lynx
Explore posts from serversAdvice for creating and managing standalone script
I’m thinking of creating a standalone widget script that users can add to their website’s <head> to show some stats from our platform. Ideally, I’d like to keep it within the same Nuxt repository as the platform to make maintenance and deployment easier.
Planning to do even more widget scripts and heavy DOM manipulations in the future, so looking for something that will make my life easier. I looked into Petite-Vue, but it seems unmaintained. I also came across Atomico for web components, but I’m hesitant to dive into a new API like that without being sure it’s the right fit.
I’d really appreciate any advice or suggestions on the best approach to take here!
9 replies
CDCloudflare Developers
•Created by Lynx on 9/27/2023 in #general-help
How does Cache Purge API works?
I forcibly cached the API endpoints that are not very dynamic on one of my sites by writing a Cache Rule. I set the Edge TTL to 2 hours and the Browser TTL to disable.
When I send the link of the endpoint I want to purge to Cache Purge, I get a successful response and when I go directly to the API endpoint, for example https://api.example.com/api/list, I can see the newly added or removed data with status code 200. When I refresh the page, it continues to fetch from the cache with code 304.
But when I try to fetch this API endpoint from another domain, for example https://example.com, I still see the old data with status code 304.
In short, when I access the endpoint directly, it is up-to-date, but when I fetch this endpoint from another domain, I see old data. Why this is happening and how can i solve this issue? 🤔
6 replies