You could use a sanitized version of the URL as part of the name of the transient … but transient names are limited in their size.
I would store the transient as an array with the URL and the HTML as two parts. Then check if the URL is the same. If it is, use the HTML, else update the transient. Do not save two depended values in different places; this leads to unnecessary synchronization problems.
Related Posts:
- Are transients garbage collected?
- How does object caching work?
- Fallback when Transient API fails
- What to use , set_transient, set_option or file system? [closed]
- How to cache posts based on $_GET? Option name is too long? Options / transients
- How to pass arguments from add_settings_field() to the callback function?
- how to update serialized options programatically?
- Will it break my site if I delete all transient records in wp_options table?
- Performance with autoload and the options table
- What’s the difference between Options & Settings?
- No option to allow search engines to index my site in WP 4.3
- How to update an ‘array’ option using wp-cli [duplicate]
- Settings API – changing add_settings_field() output?
- Confirmation before deleting plugin options via uninstall.php
- Set WordPress settings programmatically
- Submenu pages delete settings from options array when saved
- get_option() from another wordpress site
- How can I get all user options?
- Settings API – save an array of options as one setting (array_push?)
- Where to hook register_settings for Settings API when also want to update options outside of Settings API?
- How much string content can I store in an option?
- Save Theme Options (options.php) From The Frontend
- Long option names fail silently?
- Can’t output do_settings_sections . Can’t understand why
- checkbox with get_option not working
- Settings API – how to update multiple options manually?
- Single callback with multiple setting fields
- Any way to partition wp_options?
- How do I add a value to a wp_options option that is an array?
- how can I detect that option value has changed?
- Can I use a space in an option name/key?
- How to display some settings for super admin user only using Settings API
- Is there a limit to the number of options you can store in one settings field of wp_options?
- wp_user_roles and Advanced Manipulation
- Deploy pre-configured database
- Access general settings trough wordpress files
- Settings API: Change position of custom setting field
- Tab from Settings API resetting all options with INSERT INTO [closed]
- Getting settings saved two times in settings page with tab
- Can’t save options
- Where is the submitted $_POST array stored after an option page submission?
- update a value in wp_options [closed]
- Insufficient permissions to save options
- Can we allow users to choose front page from theme options?
- save_post_{CPT} not updating the ‘sticky_posts’ option
- Storing product price data in the database
- Settings API – Separating PHP and HTML
- Implementing action correctly
- Classes and functions involved in serialization and unserialization
- why is unregister_setting() undefined?
- options-general.php page displays different sitename, home compared to wp_options table
- Cannot save using register_setting
- How to create color scheme for my custom theme?
- Testing for addon plugin activated
- update a value in wordpress wp_options
- Where have the Privacy Settings gone in WordPress 3.5?
- How to save custom settings api fields with custom section fuction
- problem with get_option in dashboard
- Custom options in plugin, register_settings not working as no options.php?
- Google fonts dropdown in Options Framework
- How can I increase the font sizes used by the WordPress visual and HTML post editors?
- How do I retrieve multiple values from a multidimensional array in wp_options?
- Displaying the full text instead of post title
- Which Hook can I use when creating unique post but not update/save/delete
- Updating just one option with update_option
- Upload file on pre_update_option_{option_name}
- how create an html table with all values from a serialized array in option_value
- Custom Plugin Options Won’t Update
- WP Options Query “Rewrite Rules” Taking 10 Seconds After Testing wp_insert_post( )
- Accept code input into Options Framework
- WordPress Settings API settings not saving for some users
- Problem saving wordpress settings with current version. Is it a bug?
- How can I clear memcached WordPress site options by hand?
- Autopopulate a value
- What is the XSSAttack option_name for in the options table?
- Save Plugin Options as Array
- Retrieve my custom settings in the settings/ API endpoint
- Multiple checkbox doesn’t work in wordpress settings api
- Move website from root to sub
- Is saving data to WordPress options as array bad thing to do?
- centralized alternative for get_option: get_site_option, get_network_option or get_site_meta?
- Some entries delete_option doesn’t work
- Button to clear transients
- Options saved and called in wrong order
- Editing a loaded WordPress option without updating the database
- User specific settings, limited by role
- Remove Edit Profile option but still have the profile viewable
- Hold a comment in the queue if it contains [X] or more links
- How do I create settings only used by my theme? [closed]
- Trying to change settings -> firefox downloads options.php instead
- Move one option value into another option
- Adding data to options table
- how can i add_option as array from a form with just a text input
- Incorporating the Settings API in WordPress Themes – by Chip Bennet
- How to add options for Pages?
- options validator input is false?
- Best place to store company address
- $wpdb->update does not update, var_dump of data is correct
- Where to adjust presets for slider options “auto rotate” (3, 5, 10, 15 seconds)? [closed]
- Fatal error: Call to undefined function get_option()