Slow WP Performance on WP-Discourse API Endpoint "discourse-comments"

Hello, All! My first post here.

I am currently working on integrating a 10+ old WP site with Discourse. I have gone to great lengths to ensure that the WP instance is clean and running well with 10 years of data. After installing the WP-Discourse plugin and getting things setup (properly, I hope), the server kept getting slogged. It is hosted on Cloudways, so I asked those engineers if I was missing anything.

They responded that /wp-json/wp-discourse/v1/discourse-comments?post_id=undefined was causing a huge performance hit. I’m not sure exactly why post_id’s would be undefined.

The following picture is a list of url requests within a 24 hour period.

Any thoughts on how I can fix this error? I have searched a lot for a good answer to this. Just making sure I get some insight before deep diving into the nuances of the code.

늦게 답변드려 죄송합니다. 휴가 중이었습니다.

/wp-json/wp-discourse/v1/discourse-comments 경로로 요청이 들어오는 문제는 ‘Load Comments With Ajax’ 옵션이 활성화되어 있을 때만 발생합니다. 해당 옵션은 WP Discourse 댓글 설정 탭에서 찾을 수 있습니다. 해당 설정을 비활성화해 보실 수 있을까요?

걱정 마세요, @simon - 여행 잘 다녀오셨길 바랍니다!

오늘 저녁에 해당 설정을 비활성화하고 곧 결과를 공유하겠습니다!

감사합니다!

해당 설정을 비활성화하면 /wp-json/wp-discourse/v1/discourse-comments에 대한 요청이 발생하는 문제를 해결할 수 있습니다. 그래도 문제가 해결되지 않으면 알려주세요.

해당 라우트로의 요청이 post_id=undefined 파라미터와 함께 전송된 이유는 정확히 알지 못하겠습니다. 요청에는 현재 게시물의 id가 사용되어야 합니다. post_id 파라미터가 undefined로 설정되면 해당 라우트를 처리하는 함수가 빈 문자열을 반환합니다. Ajax로 댓글 로드 옵션을 활성화하면 비활성화할 때보다 서버에 더 많은 요청이 발생하므로, 캐싱으로 인해 댓글이 업데이트되지 않는 문제를 겪고 있는 경우를 제외하고는 해당 옵션을 비활성화 상태로 두는 것이 좋습니다.