No results found. Try again with different words?
Search must be at least 3 characters.
- Section
- Troubleshooting – Icons missing from the blocks
- Spectra Patterns
- How to Set Multiple Column Fields in Contact Form 7 Styler of Spectra?
- Styling Checkbox / Radio / Acceptance control in Contact Form 7 Designer block of Spectra
- Unable to Style Checkbox / Radio Buttons / Acceptance Control using Contact Form 7 Styler of Spectra
- Tab Index – for multiple Gravity Forms
- How to Get Started with Spectra
- How to Exclude A Heading from Table of Contents?
- Spectra – Display Conditions for Blocks
- Installing and Importing Starter Templates
- How to Get Started with Spectra
- Manually Install Spectra via FTP
- Automatic Beta Updates for Spectra
- How to Rollback to Previous Spectra Versions
- How to Load Google Fonts Locally
- Activate the Spectra Pro License Key
- How to Install Spectra Pro Plugin
- Translate Spectra Strings using Loco Translate
- How to add a Transparent / Sticky header?
- How to Change the Site Logo?
- How to Change Global Styles?
- How to Disable Title on Posts, Pages?
- How to add a transparent/ sticky header for a single page/post?
- Change Header and Footer Patterns in Spectra One Theme
- Add Custom/Google Fonts In Spectra One
- How to reset global default styling?
- Manually Install Spectra One via FTP?
- Disable or Enable Header/Footer for Specific Pages/Posts
File Generation
Spectra offers a feature that allows you to fine-tune your website’s performance by controlling how CSS and JS (JavaScript) are loaded.
By default, Spectra loads CSS and JS inline on the page, but if you’re looking for more advanced optimization, you can generate separate CSS and JS files for Spectra blocks.
In this article, we’ll explore the advantages of the Spectra file generation feature and how you can use this feature.
What is Spectra’s Inline Loading
When Spectra loads CSS and JS inline on the page, it means that these styles and scripts are embedded directly into the HTML of your web pages.
This approach offers simplicity and ensures that all necessary parts of the website are readily available when a user visits your site.
It can be an excellent choice for smaller websites or when you want to minimize the number of HTTP requests, which can affect page load time.
What is Spectra’s Advanced Separate File Generation Approach
On the other hand, if you enable the option to generate separate CSS and JS files for Spectra blocks, the plugin will create distinct external files for these assets. This approach can offer several advantages:
- Caching: Think of it like this – when you visit a place frequently, you remember the way, right? Web browsers do something similar. They store external CSS and JS files in your computer’s memory so that when you visit different parts of a website, these files are already there. This makes the website load faster because it doesn’t have to fetch those files again and again from the internet.
- Parallel Loading: When you visit a modern website, the browser uses parallel loading to fetch and display multiple elements like images, stylesheets, and scripts concurrently, significantly speeding up the web page’s loading process for a smoother user experience.
- Optimization: Optimization is like making things work really efficiently. External files can be made to work better and faster separately.
When to Choose Inline Loading
You can choose inline loading:
- For smaller websites with minimal CSS and JS assets.
- When you want to simplify asset management and reduce the number of HTTP requests.
- When you need to ensure that styles and scripts are immediately available on the page.
When to Choose Separate Files
You can choose separate CSS and JS files for Spectra blocks when:
- For larger websites with extensive CSS and JS requirements.
- When optimizing for performance.
- When you want to fine-tune and compress assets individually for efficiency.
The choice between inline loading and separate files depends on the specific needs of your website. Understanding the differences and advantages of each approach allows you to make an informed decision that aligns with your performance goals.
How to Enable File Generation Option
If you want to generate separate CSS and JS files for Spectra blocks, enable the File Generation option.
To do this, please navigate to Spectra > Settings > Asset Generation > File Generation.
So, why not give it a try on your website? If you have questions or need assistance, feel free to reach out to us, and we’ll be happy to help you get the most out of Spectra’s performance features.
Note
We don't respond to the article feedback, we use it to improve our support content.