apache - mod_rewrite to serve static cached files if they exist and if the source file hasn't changed -


i working on project processes images, saves processed images in cache, , outputs processed image client. lets project located in /project/, cache located in /project/cache/, , source images located wherever else on server (like in /images/ or /otherproject/images/). can set cache mirror path source image (e.g. if source image /images/image.jpg, cache image /project/cache/images/image.jpg), , requests project /project/path/to/image (e.g. /project/images/image.jpg).

i serve images cache, if exist, efficiently possible. however, want able check see if source image has changed since cached image created. ideally, done mod_rewrite php wouldn't need used of work.

is possible? mod_rewrite rules need work?

alternatively, seems fine compromise have mod_rewrite serve cached file of time send 1 out of x requests php script files cached. possible?

you cannot acces file modification timestamp rewriterule, there no way around using php or programming language task.

on other hand simple in php, should first check whether php solution enough in case. if isn't should alternatives.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -