I am currently facing an issue with rendering a Django template using VueJs through CDN. Upon loading the page, I notice that the raw Django code is displayed initially before being rendered by VueJs, which typically takes less than a second.
To fetch data from an API and display it on the page, I used the Fetch method within the mounted() function. However, this resulted in a delay of approximately 0.6 seconds, during which Django content would appear before VueJs rendering kicks in.
After switching from mounted() to beforeMount()
, I observed that although Django content still occasionally shows up first, the overall rendering process has improved significantly as VueJs rendering often takes precedence.
Despite these adjustments, I'm wondering if there is a more effective solution to address this issue. It's worth noting that I prefer not to explore server-side rendering for this particular project and have opted to utilize CDN instead.