/* Licensed to the Apache Software Foundation (ASF) under one or more *contributorlicenseagreements.SeetheNOTICEfiledistributedwith *thisworkforadditionalinformationregardingcopyrightownership. *TheASFlicensesthisfiletoYouundertheApacheLicense,Version2.0 *(the"License");youmaynotusethisfileexceptincompliancewith *theLicense.YoumayobtainacopyoftheLicenseat * *http://www.apache.org/licenses/LICENSE-2.0 * *Unlessrequiredbyapplicablelaworagreedtoinwriting,software *distributedundertheLicenseisdistributedonan"ASIS"BASIS, *WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied. *SeetheLicenseforthespecificlanguagegoverningpermissionsand *limitationsundertheLicense.
*/
/* if we're here at all it's because someone explicitly *settheactiveflag
*/
dir_config->active = ACTIVE_ON; if (arg == 0) {
dir_config->active = ACTIVE_OFF;
} return NULL;
}
/* check_code() parse 'code' and return NULL or an error response *string.IfwereturnNULLthenreal_codecontainscodeconverted *tothecnnnnformat.
*/ staticchar *check_code(apr_pool_t *p, constchar *code, char **real_code)
{ char *word; char base = 'X'; int modifier = 0; int num = 0; int factor;
staticconst command_rec expires_cmds[] =
{
AP_INIT_FLAG("ExpiresActive", set_expiresactive, NULL, DIR_CMD_PERMS, "Limited to 'on' or 'off'"),
AP_INIT_TAKE2("ExpiresByType", set_expiresbytype, NULL, DIR_CMD_PERMS, "a MIME type followed by an expiry date code"),
AP_INIT_TAKE1("ExpiresDefault", set_expiresdefault, NULL, DIR_CMD_PERMS, "an expiry date code"),
{NULL}
};
switch (code[0]) { case'M': if (r->finfo.filetype == APR_NOFILE) { /* file doesn't exist on disk, so we can't do anything based on *modificationtime.Notethatthisdoes_not_loganerror.
*/ return DECLINED;
}
base = r->finfo.mtime;
additional_sec = atoi(&code[1]);
additional = apr_time_from_sec(additional_sec); break; case'A': /* there's been some discussion and it's possible that *'accesstime'willbestoredinrequeststructure
*/
base = r->request_time;
additional_sec = atoi(&code[1]);
additional = apr_time_from_sec(additional_sec); break; default: /* expecting the add_* routines to be case-hardened this *isjustareminderthatmoduleisbeta
*/
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01500) "internal error: bad expires code: %s", r->filename); return HTTP_INTERNAL_SERVER_ERROR;
}
/* Don't add Expires headers to errors */ if (ap_is_HTTP_ERROR(r->status)) { return;
} /* Say no to subrequests */ if (r->main != NULL) { return;
}
conf = (expires_dir_config *) ap_get_module_config(r->per_dir_config,
&expires_module);
/* Check to see if the filter is enabled and if there are any applicable *configdirectivesforthisdirectoryscope
*/ if (conf->active != ACTIVE_ON ||
(apr_is_empty_table(conf->expiresbytype) && !conf->expiresdefault)) { return;
}
ap_add_output_filter("MOD_EXPIRES", NULL, r, r->connection);
}
staticvoid register_hooks(apr_pool_t *p)
{ /* mod_expires needs to run *before* the cache save filter which is *AP_FTYPE_CONTENT_SET-1.Otherwise,ourexpireswon'tbehonored.
*/
ap_register_output_filter("MOD_EXPIRES", expires_filter, NULL,
AP_FTYPE_CONTENT_SET-2);
ap_hook_insert_error_filter(expires_insert_filter, NULL, NULL, APR_HOOK_MIDDLE);
ap_hook_insert_filter(expires_insert_filter, NULL, NULL, APR_HOOK_MIDDLE);
}
AP_DECLARE_MODULE(expires) =
{
STANDARD20_MODULE_STUFF,
create_dir_expires_config, /* dir config creater */
merge_expires_dir_configs, /* dir merger --- default is to override */
NULL, /* server config */
NULL, /* merge server configs */
expires_cmds, /* command apr_table_t */
register_hooks /* register hooks */
};
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.16 Sekunden
(vorverarbeitet am 2026-09-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.