Hello,

I have been trying to address performance issues with displaying videos as links in a view, that once a user clicks the link (in my case thumbnails) from any video provider a lightbox window will load. The loaded lightbox modal dialog will then call the modal display for the emvideo module.

The problem is the processing to render the embed code then the theme template wrapper can take up to 16 seconds to render, then client-side the browser will request the 3rd party content.

I have been reviewing the code for the modal display and was wondering if we could use caching for this so it only needs to run once query instead of 40-60?

I was reading this article here: http://www.lullabot.com/articles/a-beginners-guide-to-caching-data
Although it is related to Drupal 5 and is somewhat old the basic design pattern is still usable in D6 (and maybe D7).

I'll update my post with code examples and or a patch if I get the caching to work.

Comments

emptyvoid’s picture

The problem is the rendering of the embed code.
The modal dialog calls a path like so:

http://www.example.com/emvideo/modal/477/540/311/field_video_url/vimeo/6...

The rendering function:
a) loads the entire node
b) Loops through all file fields
c) Calls an embed theme function
d) Call the page theme function
e) Returns the result.

This can be very costly in terms of performance and I think we could provide a set of caching functions prior to running the rendering function and returning the result.

Of course we would need to provide an additional interface to clear the cache site wide and the ability to clear the cache for a single node. (maybe every time a node is saved with the field it clears the cache?

Thoughts?

Alex UA’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Status: Active » Needs work

This sounds like a good idea, and I too have been seeing performance issues with the modal popups on our site. Would you like to attempt a patch @emptyvoid?