[wp-trac] [WordPress Trac] #58286: Growing database due to unnecessary transients containing "g_url_details_response_"

WordPress Trac noreply at wordpress.org
Wed May 10 14:05:19 UTC 2023


#58286: Growing database due to unnecessary transients containing
"g_url_details_response_"
--------------------------+------------------------------
 Reporter:  davidki       |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Database      |     Version:  6.2
 Severity:  critical      |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------
Description changed by SergeyBiryukov:

Old description:

> I created 2 external links in the block editor. This created 2 different
> transients in the database in wp_options, that have a different dynamic
> part at the end:
>
> _site_transient_g_url_details_response_ab62baf1c770821f259d255001f7a9b9
> _site_transient_g_url_details_response_f6ce245428f26d29c355a44ceb3b9bf3
>
> This transient contains "g_url_details_response_" and is produced by file
> class-wp-rest-url-details-controller.php
>
> The value of such created transient is entire html from URL to which I
> link.
>
> I only want to add some external link in gutenberg editor. Why on earth
> is necessary to parse the entire html from URL to which I link?
>
> What if I will have for example 20 external affiliate links on one page
> and I will have 1000 such pages.
>
> This will unnecessarily bloat the database with useless and unnecessary
> data!
>
> How can I prevent the creation of transients whose name part contains
> "g_url_details_response_"?
>
> I tryed it using this filter:
> apply_filters( "pre_set_site_transient_{$transient}", mixed $value,
> string $transient )
>
> But it needs full transient name, which is created dynamically using this
> function
>
> private function build_cache_key_for_url( $url ) {
>                 return 'g_url_details_response_' . md5( $url );
>         }
>
> from file class-wp-rest-url-details-controller.php
>
> So please remove these pointless transients from wordpress or give users
> a way to prevent them from being created!
>

>
> Thank you for any reply,
>
> david

New description:

 I created 2 external links in the block editor. This created 2 different
 transients in the database in wp_options, that have a different dynamic
 part at the end:
 {{{
 _site_transient_g_url_details_response_ab62baf1c770821f259d255001f7a9b9
 _site_transient_g_url_details_response_f6ce245428f26d29c355a44ceb3b9bf3
 }}}

 This transient contains "g_url_details_response_" and is produced by file
 class-wp-rest-url-details-controller.php

 The value of such created transient is entire html from URL to which I
 link.

 I only want to add some external link in gutenberg editor. Why on earth is
 necessary to parse the entire html from URL to which I link?

 What if I will have for example 20 external affiliate links on one page
 and I will have 1000 such pages.

 This will unnecessarily bloat the database with useless and unnecessary
 data!

 How can I prevent the creation of transients whose name part contains
 "g_url_details_response_"?

 I tryed it using this filter:
 {{{
 apply_filters( "pre_set_site_transient_{$transient}", mixed $value, string
 $transient )
 }}}

 But it needs full transient name, which is created dynamically using this
 function
 {{{
 private function build_cache_key_for_url( $url ) {
         return 'g_url_details_response_' . md5( $url );
 }
 }}}
 from file class-wp-rest-url-details-controller.php

 So please remove these pointless transients from wordpress or give users a
 way to prevent them from being created!



 Thank you for any reply,

 david

--

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58286#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list