Muhammed/sc 10025/wp graphql gql plugin needs to ensure it#1
Muhammed/sc 10025/wp graphql gql plugin needs to ensure it#1MuhammedAO wants to merge 3 commits into
Conversation
|
This pull request has been linked to Shortcut Story #10025: [wp-graphql] GQL plugin needs to ensure it send no caching instruction on NULL nodes. |
There was a problem hiding this comment.
oh wait @humet this is not the correct PR. remember you reached out to the developer who said this wasn't gonna work and that we should tackle on the wp-graphql side of things?
| if ( $this->are_all_nodes_null( $filtered_response ) ) { | ||
| header( 'Cache-Control: no-cache' ); | ||
| header( 'Pragma: no-cache' ); | ||
| update_option( 'are_all_nodes_null_flag', true ); |
There was a problem hiding this comment.
Using a Wordpress Options database field isn't a good way to achieve this. The graphql API is potentially being hit thousands of times a minute and relying on one database value will lead to problems.
You need to just use some type of static variable so it's unique for this specific request scope.
@dorumrr Could you help out here please?
There was a problem hiding this comment.
@humet As per @MuhammedAO comment above, we're looking at the wrong PR. We should be looking at Dexerto/wp-graphql#1
No description provided.