 All right, welcome, everyone, to another special episode of Ask Google Webmasters. Rawr! Today, we picked dinosaur t-shirts. Yeah, cool. Dinosaurs, because we like dinosaurs. Yeah, into dinosaurs and scary topics. Scary topics like JavaScript. It's not scary. Come on. Not scary. All right. So in the Ask Google Webmasters series, webmasters, SEOs, anyone really can submit questions to us using the hashtag Ask Google Webmasters. Yeah, and today's topic is all about JavaScript. So let's get started. All right. Root asks us on Twitter, when using the Rails asset pipeline for caching, what status code do we give the old asset? Googlebot crawls the stale assets, which we currently have 404. Do we foretend them instead? Or do we keep them alive for a couple of months? What do you think? I don't really know what a Rails asset pipeline is. Martin, can you tell us more? To be fair, it doesn't really necessarily matter to the specific question, because it's pretty much the same for every assets that you've got, and that you might update at some point. The Rails asset pipeline, however, is a way for Rails to process and pre-process your assets as you have them in development for the production-ready site. So it's basically like an automatic pipeline of dealing with your assets in your Rails application. But what it boils down to is you have old assets. You eventually have a new version of your website, and then you have new assets, like some old JavaScript, some previous version of your CSS, some images that you'll no longer having on your page, stuff like that. So how do you deal with that? Well, you just keep it around for a while until we recrawl your actual HTML content, and then we get the new assets afterwards. Because of caching, we try to make it so that we can crawl and index your pages quickly as possible, but that might mean that we're gonna keep using outdated URLs, and if you follow four of them, then we're just gonna end up with broken renders in between, and that's something you probably wanna avoid. All right, so better to keep them around for a while. For a while. And you can use your server logs to figure out when we stop asking for these assets, and then just fully remove them. Cool. Our next question comes from Michael. Michael is asking, if in pre-rendering, can you skip or replace irrelevant content like JavaScript-generated SVG bar graphs or anything else that is JavaScript-generated really? From my point of view, you should include everything as much as possible so that whenever Googlebot accesses your pages, it sees the full content. Does that kinda match? I'm not really sure, with pre-rendering, do they mean? Oh, yeah, so they can either mean, so pre-rendering really is just running your JavaScript on the server side once whenever the content changes and then deploying the static assets to everyone. In this case, no, you do not skip things, but if you mean dynamic rendering, where you would basically just give different content to the users versus crawlers, then even then I wouldn't skip it. Cool, okay, so include everything. Our next question comes from Graham. Graham asks on Twitter, if your site has a chat function that rewrites the title tag for notifications to the visitor, how do you or the app supplier prevent Google from indexing the JavaScript rewritten version of the title tag? You don't, I would say, no. So as we are rendering the page, we are picking up rewritten titles. So in that case, whoops. What you could do is you could hide or delay the chat behind the user interaction because Googlebot doesn't interact with things. So if you have to click on the chat button first and then the chat pops up and then changes the title, I think that would be one way of dealing with this properly. Michael is asking or asking again, in pre-rendering, can I still use JavaScript inside the rendered output? Is it like JavaScript that generates minor content or layout changes or anything that isn't really a heavy Ajax request? Yeah, definitely. So with pre-rendering, you're basically generating those pages ahead of time and serving all of that to users. And it's perfectly fine to have some JavaScript elements in there as well. I think from a user point of view, that makes sense anyway because sometimes you can serve content very quickly if it's pre-rendered and you can use JavaScript to add interactive elements. And that's perfectly fine to make sense. So you don't have to strip out all of the JavaScript if you pre-render your pages. Absolutely. It's also, if you do pre-rendering and then use something that's called hydration, that's basically what you're aiming at. You have all the content pre-rendered and then you use JavaScript to enhance it into a single-page web app, so for instance, that is perfectly OK. It's just about giving the content to the user as quickly as possible. So it sounds like JavaScript and SEO are going to be with us for a while again. I do think so, yes. Yeah, well, that sounds pretty cool. So one of the things I keep hearing from people is pre-rendering or dynamic rendering. Is that ever going to go away? Do I still have to bother with all of that? Yes, this question comes up a lot. So fundamentally, it will not necessarily go away entirely, maybe except for dynamic rendering. Dynamic rendering is a workaround. So we hopefully do not have to keep that around for much longer. But server-side rendering and pre-rendering are actually very fundamentally useful concepts because they give the users and crawlers the content quicker. It's HTML. We can parse that as it comes in. JavaScript needs to be parsed and executed to generate the content, so we cannot basically stream the content on the browser side. And we don't have to. We have server-side rendering available. Wow, yeah, it sounds like there's still a lot to do. Maybe we should do separate YouTube videos for that. What do you think, Martin? It's a great idea, and one we already had. If you are checking out this channel's playlist, you'll see that we have a series called JavaScript SEO already. It has a bunch of episodes that are covering many different topics already, but we are working on more episodes. So I guess subscribe to this channel to stay tuned for more. Yeah, that sounds awesome. And feel free to continue submitting your questions using the hashtag. Ask Google Webmasters. All right, thanks for watching, and see you next time. Bye.