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

[Waste] Calendar performance improvements #5193

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

davea
Copy link
Member

@davea davea commented Sep 27, 2024

  • Adds Cache-Control header to calendar.ics responses
  • No longer hits backend APIs for calendar help page

[skip changelog]

@davea davea requested a review from dracos September 27, 2024 13:03
Copy link
Member

@dracos dracos left a comment

Choose a reason for hiding this comment

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

Good spot - think it'd be clearer to stop the help page being chained entirely.

@@ -588,6 +588,13 @@ sub property : Chained('/') : PathPart('waste') : CaptureArgs(1) {
$c->detach;
}

# The calendar help page doesn't need anything but the property ID,
Copy link
Member

Choose a reason for hiding this comment

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

I think a clearer way to do this would be to stop calendar being Chained to property entirely - if it was its own route then you wouldn't need to complicate this with a special case. ie sub calendar : Path : Args(1) { or similar, then sticking the ID on the stash.

Copy link
Member Author

Choose a reason for hiding this comment

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

I did try this to begin with but couldn't figure out the right incantation - will have another go based off your suggestion 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

Have moved to LocalRegex in a22a400, though that seems to be deprecated and the docs suggest using chains instead. But I can't see a way to do that without chaining off property...

Copy link
Member

Choose a reason for hiding this comment

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

Ugh, sorry, I must have had it in my head it was calendar/ID... So this way is fine (we have a number of other LocalRegexes), or your original way - I guess the actual cleanest would be to change property to Chain off a new tiny function (property_id?) that fetched the ID and didn't do anything else, and then calendar could Chain off of property_id, leaving rest of property alone.

perllib/FixMyStreet/App/Controller/Waste.pm Show resolved Hide resolved
Copy link

codecov bot commented Sep 27, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 69.30%. Comparing base (7560279) to head (a22a400).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
perllib/FixMyStreet/App/Controller/Waste.pm 0.00% 2 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (7560279) and HEAD (a22a400). Click for more details.

HEAD has 8 uploads less than BASE
Flag BASE (7560279) HEAD (a22a400)
15 7
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #5193       +/-   ##
===========================================
- Coverage   82.50%   69.30%   -13.20%     
===========================================
  Files         406      405        -1     
  Lines       31743    31891      +148     
  Branches     5050     5072       +22     
===========================================
- Hits        26188    22103     -4085     
- Misses       4065     8293     +4228     
- Partials     1490     1495        +5     
Flag Coverage Δ
69.30% <0.00%> (-13.20%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@davea davea requested a review from dracos September 27, 2024 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants