Title: Caching localized data for js
Last modified: August 22, 2016

---

# Caching localized data for js

 *  [VGJ](https://wordpress.org/support/users/vgj/)
 * (@vgj)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/caching-localized-data-for-js/)
 * I need to enable caching and found this plugin. I am currently using s2member
   Pro as well. If the solution is in Quick Cache Pro, I have no problem paying 
   for it. With that in mind …
 * I have added Quick Cache on a dev site and everything is working except for my
   videos. I have a custom plugin managing videos that uses Kaltura. I use `wp_localize_script`
   to pass variables (granting permission to view video) to the js to embed based
   on the variables. The problem is with the variables getting passed are being 
   cached. The ‘session id’ for Kaltura could be expired. Is there a way to avoid
   this? I have a feeling I am just not thinking correctly on how to accomplish 
   this.
 * [https://wordpress.org/plugins/quick-cache/](https://wordpress.org/plugins/quick-cache/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Raam Dev](https://wordpress.org/support/users/raamdev/)
 * (@raamdev)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/caching-localized-data-for-js/#post-5275377)
 * Hello,
 * I’m not really clear on how you’re using Kaltura. Are you using `wp_localize_script()`
   inside the post where the video is (in conjunction with a plugin that allows 
   you to place PHP code inside a post)?
 * When you say everything is working except for your videos, what does that look
   like? Do the videos not load? Are the proper permissions not being detected?
 * A few more details would be helpful to troubleshoot this issue. 🙂
 *  Thread Starter [VGJ](https://wordpress.org/support/users/vgj/)
 * (@vgj)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/caching-localized-data-for-js/#post-5275378)
 * I have a custom template for a custom post type. It currently calls a function
   that returns everything needed to embed the player (including external js for
   player controls and js snippet to embed with variables). Since the current way
   is getting cached, I have since tried to use wp_localize_script to include the
   snippet with the variables. But it outputs to the page so it will get cached 
   as well.
 * The main variable I am worried about is the Kaltura Session ID. It is a session
   id that can be unique to the user and has various expires. We currently have 
   a paid membership and paid rental options.
 * The player is fine and works. But since it is cached, the cache version may go
   beyond the rental period of 2 days. For a membership, it really does not matter
   except when the id does expire or the member cancels his/her membership it needs
   to be updated immediately.
 *  Thread Starter [VGJ](https://wordpress.org/support/users/vgj/)
 * (@vgj)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/caching-localized-data-for-js/#post-5275408)
 * Any and all help would be appreciated.
 *  Plugin Author [Raam Dev](https://wordpress.org/support/users/raamdev/)
 * (@raamdev)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/caching-localized-data-for-js/#post-5275411)
 * If you’re running a membership site, or any site where users login, I recommend
   setting Quick Cache to maintain a separate cache for each user, that way session
   IDs and other information relevant to a specific user don’t end up getting cached
   and served to other visitors.
 * The Lite version of Quick Cache doesn’t have the option to maintain a separate
   cache for logged-in users, but [Quick Cache Pro](http://www.websharks-inc.com/r/quick-cache-pro-raam/)
   does have this option. Please see the screenshot of the Logged-In Users option
   panel here: [https://github.com/websharks/quick-cache/wiki/Plugin-Options#logged-in-users](https://github.com/websharks/quick-cache/wiki/Plugin-Options#logged-in-users)

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Caching localized data for js’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/quick-cache_efefef.svg)
 * [Quick Cache (Speed Without Compromise)](https://wordpress.org/plugins/quick-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/quick-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/quick-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/quick-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/quick-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/quick-cache/reviews/)

## Tags

 * [wp_localize_script](https://wordpress.org/support/topic-tag/wp_localize_script/)

 * 4 replies
 * 2 participants
 * Last reply from: [Raam Dev](https://wordpress.org/support/users/raamdev/)
 * Last activity: [11 years, 8 months ago](https://wordpress.org/support/topic/caching-localized-data-for-js/#post-5275411)
 * Status: not resolved