Support ⇒ Requests :: Archives ⇒ remove file_exists() for theme's images, js and css. :: Archived ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum IndexRequests

Archived ⇒ remove file_exists() for theme's images, js and css.


In past I've been able to improve admin pages speed by reducing disk I/O read access by 0.2 seconds for each administrative page. And looks like no one have even noticed that.

Today is time for one more speed improvement.
The system many and many times try to patch broken themes, specially for backward compatibility, by looking if the image exists in the theme then use it will use it, otherwise will use the default theme images.

My concern, at this point, is to organize images a little bit better for DragonflyCMS 9.2.

My possible and definitive fix is to organize images in a different manner
by shifting all themes related image from the core to the theme, by having an hierarchy for images as well (16x16, 32x32, ... ?) and off course still be backward compatible by having a "master" file .inc which contain an array will all images and their paths so every theme developer is free to organize images the way he likes to.

The system then will look just for the master file and merge the array with the "default" one provided and shipped with the core. The theme master file will overwrite the core file and then the system will know already where all images that it needs are, one image in the default theme, another one in the custom theme, etc etc.

The master file will contain images, javascript and css files, and why not the favicon file as well.
My target will be to gain no more then 0.2 seconds in the heaviest case that can be reproduced already at any time.

At the end who will benefice more from this are going to be busy sites or site on busy servers.
But still will not help distracted user who doesn't upload all core files.

The idea is this but still I haven't figure it out how to tag each image
array('tag' => 'path/to/image.jpg');

How that sounds?
Any suggestion?

.:: I met php the 03 December 2003 :: Unforgettable day! ::.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
CloudLinux / Apache 2.4 LSAPI / MySQLi 5.6 / PHP 5.6 / DCVS


image array already stored in cache for each theme (or is that MOO only ?)

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Fedora 25 / Apache 2.4.27 / MariaDB 10.1.26 / PHP 7.1.10 / Mercurial


Roger!
I knew that the idea was a good one Laughing

If the system will be able to create the array on its own ... then I guess it much better.

.:: I met php the 03 December 2003 :: Unforgettable day! ::.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
CloudLinux / Apache 2.4 LSAPI / MySQLi 5.6 / PHP 5.6 / DCVS


It doesn't change much for themers, though it is good sometimes to have different hierarchiy then default.

I agree that all images should be in theme folder.

The idea is this but still I haven't figure it out how to tag each image
array('tag' => 'path/to/image.jpg');

Yeah, why not. Or maybe using defines, nah I guess array is better, tooks less room also in file, probably also in memory.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
-


the whole point is to stop using file_exists() on images, css and js.

.:: I met php the 03 December 2003 :: Unforgettable day! ::.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
CloudLinux / Apache 2.4 LSAPI / MySQLi 5.6 / PHP 5.6 / DCVS


I got it before Smile

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
-

All times are UTC
This forum is locked: you cannot post, reply to, or edit topics. Forum IndexRequests
Page 1 of 1