Defer Javascript

one of the things that keeps coming up in speed tests is defer javascript. Is there a safe way to do this with x theme?

Hello @wicara,

Please try the suggestions from these related threads:

https://theme.co/apex/forum/search?q=Defer%20Javascript

Hope this helps.

so this post says the following need to be excluded:

Please exclude these files:

x-site-body
x-cranium-migration-body
x-cranium-migration-head
x-site-head
cornerstone-site-head

I am using total w3 cache plugin and I need the exact file path how do I find the path ?

Hello @wicara,

Thanks for updating the thread. :slight_smile:

Can you please let us know the plugin you are using so that we can share the solution specific to the plugin that you have on the website? In the meantime, please take a look at the solution shared in following thread:

https://wordpress.org/support/topic/how-to-use-sbp_exclude_defer_scripts-filter/

Thanks.

the plugin is W3 Total Cache Version 0.9.7.5

Hey @wicara,

It is not recommended to include all assets of our products for optimization except if the user is knowledgeable of how the optimization plugin works and everything that is used in his/her website where are products is only a part of.

It’s also not feasible for us to know how each optimization plugin works so sorry for the confusion about what Prasant said that we’ll share third-party settings. We are not in the position to say that because we are not the one handling your site. Optimization setup could differ from site to site and the work required for your site to work properly is quite involved.

Though I am not able to share specific settings with you, I could share some general knowledge. Optimization plugins usually have a way to exclude all assets of themes and plugins using regex. For your case, please contact W3 Total Cache’s support to learn how to do this with their plugin. There’s actually no point of configuring individual folders like pro/cornerstone/assets/dist/js/site/ and pro/framework/dist/js/site/ when you could do pro/*.js or something like that.

Though this will not happen frequently, folder structures might also be changed in the future for improvements our other reasons.

Thank you for understanding.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.