-
Notifications
You must be signed in to change notification settings - Fork 151
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
Prerenderd HTML dosen't get invalidated #48
Comments
Thanks for reporting, I will try to reproduce this behaviour with some of our examples later today. |
Thanks for sharing! // Icon.js
import noEntryIcon from './assets/icons8-no-entry.svg`
export default function MyIconComponent() {
return <img src={noEntryIcon} />
} Doing it this way, Next.js will output the asset as something like However what is bad here, is that we don't check if the content of the file has actually changed when doing a deployment. Looking at the screenshot, the only actual route that gets invalidated is |
Thanks for your detailed reply. The point with the assets is fair. We definitely gonna change that. However, the problem that we're facing is that the pre-rendered Html doesn't get invalidated, which results in no changes apply on our website until I manually trigger an invalidation for all directories in CloudFront. |
I've just been having a brief look into your code. In the |
Yes, that's my assumption what is happening here 👍 I also left a todo in the code, because we never actually checked a case with more than 15 invalidations. |
Ok. So, just to clarify (I'm new to next-js), is it considered best practice to load all assets from the code via webpack? I played around with a few libraries, tried |
As for all in software it depends 😄 @font-face {
font-family: 'Montserrat';
font-style: normal;
font-weight: 500;
src: local(''),
url('./fonts/montserrat-v15-latin-500.woff2') format('woff2')
} I think you don't need any additional configuration, since loading assets is already built-in in Next.js (and the underlaying webpack configuration). The important thing here is to use relative paths ( |
Well, for sure it always "depends", however, when you're using a framework it is usually opinionated and there are best practices. The next.js documentation explicitly advises to put build time assets in the public folder: |
After deployment pretended HTML doesn't get invalidated. I checked the invalidation in CloudFront, only assets (/Icons, /fonts) get invalidated.
The text was updated successfully, but these errors were encountered: