-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CDN not working good in preview mode #45
Comments
@liqueflies Agreed - this would be a good approach. How are you implementing preview mode? Are you using |
@danielroe I am using |
|
Hi @mornir, But not the first: if I am not using cdn api, when i am navigating with client it uses the no-cdn api - consuming bandwith, or not? |
Do you build your website with |
When navigating on your website, you can see in the network tab of the devtool what API calls are made. |
I built usign For me is right to use the cdn api also into static website, or the plugin should switch between generation and client navigation. I had a lot of websites built without cdn api, billing can be expansive |
In that case, you can initialize two clients. I'll give you a link to an example. Actually, I think it's not even necessary to make the API call inside the preview plugin. |
are you saying that I have initialize an additional client and switch on async data based on query string? |
I just want to share the solution that worked for me: nuxt.config.js
preview.client.js
Edit: I think that would be cool that pugin could handle something like this, sanity is very expansive with non-cdn api. If you want to discuss this you can keep open, if not you can close the issue. L. |
Is your feature request related to a problem? Please describe.
When I use nuxt preview mode, the client will refresh data with cdn API and data is not refreshed.
Describe the solution you'd like to see
I noticed that there is no way to invalidate cdn api / or change it's endpoint (from cdnUrl to hostUrl) when is into preview mode.
Describe alternatives you've considered
How about invalidate cache or switch to no-cdn mode when
preview=true
?Here to help,
L.
EDIT:
an idea could be adding a parameter to fetch that can define if we are in preview or not
The text was updated successfully, but these errors were encountered: