3

Possible Duplicate:
Long option names fail silently?

The WordPress Transients API makes it easy to save expensive values and look them up later. If you install an object backend (such as APC object cache, memcache or W3 Total Cache) you can cache these values between requests, gaining even more.

But I've noticed that when the name of a transient field is too long, it simply doesn't bother caching it. Aside from being somewhere in the region of 50 characters, I don't know what the maximum length of these names is.

Is this documented somewhere? Does it depend on what backend you're using?

2
  • 2
    have a look at this question.
    – Milo
    Commented Jun 16, 2011 at 16:53
  • I don't think that question is a duplicate. That question is asking about database transients, which are affected the wp_options schema, but this question is asking about transients stored in a persistent object cache, which are not affected by the database schema. My guess is that the OP was right, that any limit is imposed by the backend, not by WP.
    – Ian Dunn
    Commented Mar 9, 2017 at 19:35

1 Answer 1

0

A transient that doesn't expire has a max name length of 53 characters yet a transient that does expire has a max name length of 45 characters.

http://core.trac.wordpress.org/ticket/15058

1
  • 1
    I don't think that's true. That limit was for transients that were stored in the database, because the option_name column was VARCHAR(64). The OP was asking about transients stored in a persistent object cache like Memcached, which are not affected by the length of the option_name column. (Side note: the limit for database transients was raised to 172 chars in core.trac.wordpress.org/changeset/34030)
    – Ian Dunn
    Commented Mar 9, 2017 at 19:34

Not the answer you're looking for? Browse other questions tagged or ask your own question.