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

Miscalculation of template cache potential #8125

Closed
moorereason opened this issue Jan 8, 2021 · 1 comment · Fixed by #8126
Closed

Miscalculation of template cache potential #8125

moorereason opened this issue Jan 8, 2021 · 1 comment · Fixed by #8126
Assignees

Comments

@moorereason
Copy link
Contributor

As report by @davidsneighbour at https://discourse.gohugo.io/t/30475/3.

A HTML-only partial shows a cache potential of 0 instead of 100.

For example:

<div class="progress" id="readingprogress">
    <div class="progress-bar"
         id="readingprogress-bg"
         role="progressbar"
         aria-label="Readingprogress"
         aria-valuenow="0"
         aria-valuemin="0"
         aria-valuemax="100"></div>
</div>
@moorereason moorereason added the Bug label Jan 8, 2021
@moorereason moorereason self-assigned this Jan 8, 2021
moorereason added a commit to moorereason/hugo that referenced this issue Jan 8, 2021
When tracking for cache hints, track the same template name as the call
to MeasureSince() in Execute.  When referencing a partial "foo", the
value of `n` does not match `templ.Name()` (`partials/foo` versus
`partials/foo.html`), which was caused hints to not be tracked since
there was no existing metric to append the hint to.

Fixes gohugoio#8125
moorereason added a commit to moorereason/hugo that referenced this issue Jan 8, 2021
When tracking for cache hints, track the same template name as the call
to MeasureSince in Execute.  When referencing a partial "foo", the value
of `n` does not match `templ.Name()` (`partials/foo` versus
`partials/foo.html`).  This was causing hints to go untracked since
there was no existing metric to append the hint to.

Fixes gohugoio#8125
@bep bep closed this as completed in #8126 Jan 8, 2021
bep pushed a commit that referenced this issue Jan 8, 2021
When tracking for cache hints, track the same template name as the call
to MeasureSince in Execute.  When referencing a partial "foo", the value
of `n` does not match `templ.Name()` (`partials/foo` versus
`partials/foo.html`).  This was causing hints to go untracked since
there was no existing metric to append the hint to.

Fixes #8125
gzagatti pushed a commit to gzagatti/hugo that referenced this issue Jan 11, 2021
When tracking for cache hints, track the same template name as the call
to MeasureSince in Execute.  When referencing a partial "foo", the value
of `n` does not match `templ.Name()` (`partials/foo` versus
`partials/foo.html`).  This was causing hints to go untracked since
there was no existing metric to append the hint to.

Fixes gohugoio#8125
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant