2015-10-04, 11:45 PM
I display avatars on my forum index and forum display so it'd be ideal if they got cached from the cdn, but they're not because of the query strings.
is there a way to optimize this?
is there a way to optimize this?
Quote:Ignore query string
Caches static content that has a query string and treats it as one file
(2015-10-05, 05:43 AM)SentoWeb Wrote: [ -> ]Since you are using cloudflare you can tweak the caching level to serve a cached version even if there is a query string in the url. The timestamp only changes when the avatar is updated.
This cloudflare article will help:
https://support.cloudflare.com/hc/en-us/...Page-Rules-
Quote:Ignore query string
Caches static content that has a query string and treats it as one file
(2015-10-05, 05:57 AM)andrewjs18 Wrote: [ -> ](2015-10-05, 05:43 AM)SentoWeb Wrote: [ -> ]Since you are using cloudflare you can tweak the caching level to serve a cached version even if there is a query string in the url. The timestamp only changes when the avatar is updated.
This cloudflare article will help:
https://support.cloudflare.com/hc/en-us/...Page-Rules-
Quote:Ignore query string
Caches static content that has a query string and treats it as one file
I'm using incapsula, not cloudflare.
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 hour"
<IfModule mod_headers.c>
Header append Cache-Control "public"
</IfModule>
</IfModule>
$updated_avatar = array(
"avatar" => $avatar['avatar'].'?dateline='.TIME_NOW,
"avatardimensions" => $avatar_dimensions,
"avatartype" => "upload"
);
$db->update_query("users", $updated_avatar, "uid='".$mybb->user['uid']."'");
$updated_avatar = array(
"avatar" => $avatar['avatar'],
"avatardimensions" => $avatar_dimensions,
"avatartype" => "upload"
);
$db->update_query("users", $updated_avatar, "uid='".$mybb->user['uid']."'");
$extra_user_updates = array(
"avatar" => $avatar['avatar'].'?dateline='.TIME_NOW,
"avatardimensions" => $avatar_dimensions,
"avatartype" => "upload"
);
$extra_user_updates = array(
"avatar" => $avatar['avatar'],
"avatardimensions" => $avatar_dimensions,
"avatartype" => "upload"
);