updatedate

PHP filemtime vs MySQL last updated timestamp for image caching in CMS

微笑、不失礼 提交于 2019-12-12 21:17:00
问题 I'm trying to determine if it's better to store an image's last modified date in a MySQL database or use the PHP function filemtime. In my case, all of the website info is stored in a database (cms), so there is always a query to pull the image path, etc. The question is for caching purposes I need to have my HTML output something like this <img src="/img/photo.jpg?v20190613" /> . From what I read on the php.net website this function is cached. So would it use fewer resources to add a field