PHP OOP & Prozedural Wann ist OOP unnötig?

  • Ersteller Ersteller omaliesschen
  • Erstellt am Erstellt am
Es funktioniert bei lighttpd ziemlich ähnlich in der conf, nur dass man dort keine Dateitypen angibt, sondern Verzeichnisse.

Code:
expire.url = (    "/js/" => "access plus 7 days", 
		  "/css/" => "access plus 2 weeks", 
		  "/images/" => "access plus 2 months"
		  // usw...
)

edit: Natürlich nur, wenn mod_expire bei den modules steht.
 
Zuletzt bearbeitet:
With expire.url:
$HTTP["url"] =~ "\.(jpg|gif|png|css|js|txt|ico)$" {
expire.url = ( "" => "access plus 2 days" )
}
In some versions of lighttpd above rule wont works, in that case use setenv.add-response-header to set expire interval.
With setenv.add-response-header:
$HTTP["url"] =~ "\.(jpg|gif|png|css|js|txt|ico)$" {
setenv.add-response-header = ( "Cache-Control" => "max-age=290304000, public" )
}
Quelle: http://itnewscast.com/servers-storage/lighttpd-add-expire-and-cache-control-headers

Anmerkung:
It is known that mod_expire may not work due to an incorrect order of loading of modules. One instance is that mod_expire is loaded after mod_fastcgi. The solution is simple, it is to move mod_expire within the modules array in front of mod_fastcgi. Note: The order of the modules is loaded from top to bottom.
Quelle: http://redmine.lighttpd.net/projects/1/wiki/Docs_ModExpire
 
Zuletzt bearbeitet:
Zurück
Oben