k0a1a / hotglue2

HOTGLUE is a Content Manipulation System which allows to construct websites directly in a web-browser.
http://hotglue.me/demo
GNU General Public License v3.0
275 stars 38 forks source link

Images are served every time #1

Closed towolf closed 8 years ago

towolf commented 11 years ago

and never hit the browser cache. This is bad for image heavy pages.

k0a1a commented 9 years ago

could you please elaborelaborate on this one? thanks!

dereckson commented 9 years ago

@k0a1a I guess @towolf would like images are served with some headers requiring the browser to cache the files. The goal is to avoid to query the server too many times and decrease the server load.

A comprehensive guide on this topic is http://www.mobify.com/blog/beginners-guide-to-http-cache-headers/


@towolf You can also do this at server level by the way. See for example http://serverfault.com/questions/23157/setting-expires-headers-for-static-content-served-from-nginx and http://stackoverflow.com/questions/447014/website-image-caching-with-apache

I would cache .head.. The (untested) regexp ^.*.head.[0-9]$ should identify such files.

k0a1a commented 9 years ago

ok, right, I get the point now, cheers. @towolf if you look at the image file response headers at http://hotglue.me - do you see desired cache entries? it is done on the serverside though. one of the reasons for not caching by default is that hotglue provides its own, 'pre-parsed' cache, which is hard to keep properly updated shall we rely on browser caches. perhaps one option is to not have any caching in editing more but have it enabled for viewing.