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

[SDPAP-8087] Use GET to allow AJAX request #432

Merged

Conversation

vincent-gao
Copy link
Contributor

@vincent-gao vincent-gao commented Sep 11, 2023

Jira

https://digital-vic.atlassian.net/browse/SDPAP-8087

Problem/Motivation

The site_alert js is making a POST request to the {{ajax/site_alert}}resource every 5 seconds.

This leads to a significant number of requests being made to the CMS that cannot be cached.

Fix

Use HTTP GET to allow caching of AJAX request

Related PRs

https://www.drupal.org/project/site_alert/issues/3160200#comment-15217710

Screenshots

CleanShot 2023-09-11 at 13 52 27

The router responsible for handling ajax/site_alert requests has already cached the response.
https://git.drupalcode.org/issue/site_alert-3160200/-/blob/3160200-use-http-get/src/Controller/SiteAlertController.php#L126

@vincent-gao vincent-gao force-pushed the feature/SDPAP-8087-site_alert-polling-is-too-frequent branch from 524fdc7 to b8567be Compare September 11, 2023 03:01
@vincent-gao vincent-gao force-pushed the feature/SDPAP-8087-site_alert-polling-is-too-frequent branch from b8567be to f7da8b6 Compare September 11, 2023 03:50
@vincent-gao vincent-gao self-assigned this Sep 11, 2023
Copy link
Contributor

@anthony-malkoun anthony-malkoun left a comment

Choose a reason for hiding this comment

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

Be nice to get those issues progressed. Can they both be a focus of bugsmash? Also maybe include full link to issue as it's not clear what is being updated here, e.g. https://www.drupal.org/project/site_alert/issues/3160200

@vincent-gao vincent-gao merged commit 5f08fe3 into develop Sep 18, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants