Nonce Lifetime

Hi there,

So I cache the site. I was wondering if you can tell me the time the theme’s Nonces last for?

I don’t know if you use nonces or not, but if you do, it might cause the site to break as users are being served a cached version of something that is expired.

Setting the cache lifespan to that time will fix the issue.

J.

Hello @JfantasyBooks,

Thanks for writing in! :slight_smile:

For now, all we can advise you is to delete your style cache everytime you switch themes, have V2 element errors, have builder errors, etcetera. To shorten things, please make it a habit when there are major changes on your site.

I have already added this to our list of feature requests. This request however, will be taken into consideration for future development. All of the requests are discussed with our team internally and prioritized based on the amount of interest a particular feature might receive.

Thank you for your continued patronage.

Not really what I was getting to.

I was just wonder if x theme uses nonces, and if so, is the lifetime of the nonces shorter than standard?

J.

Hi J,

The theme uses nonces. It utilizes the WP function wp_create_nonce() which default life is based on Wordpress *86,400 seconds. You can modify it using
apply_filters( 'nonce_life', int $lifespan )

Hope this helps.

Just a bit of clarification. They’re only used to make sure a logged in user’s session is valid. We don’t use them to cache the site. Ensuring your users don’t get stale content would be something you control from a caching plugin or server configuration (not the theme).

Oh, that clarifies things. Thanks!

1 Like