Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preload files #38

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions skins/tailwindui/layouts/_head.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@
?>

<?php foreach ($styles as $style) : ?>
<link href="<?= $style . '?v=' . $coreBuild; ?>" rel="stylesheet" importance="high">
<link href="<?= $style . '?v=' . $coreBuild; ?>" rel="preload" as="style" importance="high">
<link rel="preload" href="<?= $style . '?v=' . $coreBuild; ?>" as="style">
<link rel="stylesheet" href="<?= $style . '?v=' . $coreBuild; ?>">
<?php endforeach; ?>

<?php foreach ($scripts as $script) : ?>
<script data-cfasync="false" src="<?= $script . '?v=' . $coreBuild; ?>" importance="high"></script>
<link href="<?= $script . '?v=' . $coreBuild; ?>" rel="preload" as="script" importance="high">
<link rel="preload" href="<?= $script . '?v=' . $coreBuild; ?>" as="script">
<script src="<?= $script . '?v=' . $coreBuild; ?>"></script>
<?php endforeach; ?>

<?php if (!Config::get('cms.enableBackendServiceWorkers', false)) : ?>
Expand Down
8 changes: 4 additions & 4 deletions skins/tailwindui/layouts/_head_auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
?>

<?php foreach ($styles as $style) : ?>
<link href="<?= $style . '?v=' . $coreBuild; ?>" rel="stylesheet" importance="high">
<link href="<?= $style . '?v=' . $coreBuild; ?>" rel="preload" as="style" importance="high">
<link rel="preload" href="<?= $style . '?v=' . $coreBuild; ?>" as="style">
<link rel="stylesheet" href="<?= $style . '?v=' . $coreBuild; ?>">
<?php endforeach; ?>

<?php foreach ($scripts as $script) : ?>
<script data-cfasync="false" src="<?= $script . '?v=' . $coreBuild; ?>" importance="high"></script>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data-cfasync is required to work well with CloudFlare AFAIK

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<link href="<?= $script . '?v=' . $coreBuild; ?>" rel="preload" as="script" importance="high">
<link rel="preload" href="<?= $script . '?v=' . $coreBuild; ?>" as="script">
<script src="<?= $script . '?v=' . $coreBuild; ?>"></script>
<?php endforeach; ?>

<?php if (!Config::get('cms.enableBackendServiceWorkers', false)) : ?>
Expand Down