Skip to content

swissup/module-speculation-rules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Magento 2 Speculation Rules module

Description

The Speculation Rules API is a JSON-defined API developed by Google to enhance the performance of web page loading through speculative loading strategies. One more description by Mozilla MDN.

How Does It Work?

Google's Speculation Rules API is designed to target document URLs rather than specific resource files. The Speculation Rules API introduces a more expressive and configurable syntax for specifying which documents should be prefetched or prerendered. With a structure defined in JSON format within a script type="speculationrules", developers can articulate rules for both prerendering and prefetching. This enhanced flexibility allows for fine-tuning speculative loading.

Pagespeed Impact

Prerender with the Speculation Rules API

Browser Support

Can I use Speculation Rules?

For clients
cd <magento_root>
composer require swissup/module-speculation-rules
bin/magento module:enable Swissup_SpeculationRules Swissup_Core
bin/magento setup:upgrade
For maintainers
cd <magento_root>
composer require swissup/module-speculation-rules:dev-master --prefer-source
bin/magento module:enable Swissup_SpeculationRules Swissup_Core
bin/magento setup:upgrade

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published