dongmeng2509 2011-07-15 10:06
浏览 30

我们如何使用Zend Framework从数据库生成动态图像

Problem:

I could not find a proper/working info googling about caching dyanamic images, as per my requirement.

I am using Zend Framework and url of the images looks like http://localhost/media/image/id/1120. The images are stored in the database.

Is there any way I can cache my images.

One of the Resouce Looked at: http://dtbaker.com.au/random-bits/how-to-cache-images-generated-by-php.html

This is the closet I could get and the images are cached in this website but can't make it work on situation like mine.

A help would be great.

  • 写回答

1条回答 默认 最新

  • dongyanfeng0563 2011-07-15 10:25
    关注

    If you are using Zend Framework, then your first port of call for caching anything should be Zend_Cache.

    Having said that, caching images is probably the easiest caching problem to solve as it is just a matter of saving a local copy of any image to your server after it is generated and checking for a local copy before running the code that generates it.

    Something like:-

    if(file_exists(image12345.png){
        serve cached file;
    } else {
        generate new file;
        save new file to image12345.png;
        serve cached file;
    }
    

    Looking at your user name you should be able to work out real, working code for yoursel(f)(ves).

    评论

报告相同问题?

悬赏问题

  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题