Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
I ran analysis about page generation. A page load with 15 s3 styled image is extrem slow! Checking every file in cloud needs a lot time.
Proposed resolution
We should maintain a db table + cache layer to improve performance.
fid|style_id|state
In GetExternalUri() we can check cache first, then db, then in cloud.
Need to update db table on
- hook_file_move
- hook_file_delete
- hook_image_style_flush
What do you think? If you ok with it, I can do until next week.
Comment | File | Size | Author |
---|---|---|---|
#4 | 2537076-1-2537076-4-interdiff.txt | 646 bytes | szantog |
#4 | 2537076-4-db-cache-styles.diff | 6.05 KB | szantog |
#1 | 2537076-1-db-cache-styles.diff | 5.85 KB | szantog |
Selection_215.png | 9.87 KB | szantog |
Comments
Comment #1
szantog CreditAttribution: szantog as a volunteer commentedHere is the first patch. I'll try it on live site soon. (I mean our dev environment of our live site. :))
Meanwhile I figured out the proper hooks to manage db table.
Comment #2
szantog CreditAttribution: szantog as a volunteer commentedComment #3
szantog CreditAttribution: szantog as a volunteer commentedComment #4
szantog CreditAttribution: szantog as a volunteer commentedFixed wrong condition of db checking, added new cache table to flush_caches.
Comment #5
deviantintegral CreditAttribution: deviantintegral at Lullabot commentedI'm a little confused by this. The S3 SDK already has a metadata cache built in. Is that not being hit for the file_exist calls? Have you disabled the metadata cache on the settings screen? It should be enabled by default.
Comment #6
deviantintegral CreditAttribution: deviantintegral at Lullabot commented