Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not Solved image of the attachment in the post be cached?
#1
Not Solved
When I attach an image with mybb attachment function

the image file is not cached and is loaded every time I load the page.

This is a waste of traffic

Can an attached image be cached?
Reply
#2
Not Solved
(08-06-2018, 12:23 AM)alstn13178 Wrote: The image url of mybb's attachment ends in php, not ending in png or jpg.


So I do not know if the image is cached. 

image of the attachment in the post be cached?

I am not aware of any images ending in .php. 

.php is a source hypertext file, not an image.
I'm Serpius and You're Not    ¯\_(ツ)_/¯
[Image: y3xr3cj5]
Reply
#3
Not Solved
So I do not know if the image is cached. 

image of the attachment in the post be cached?


when I upload image. I get php url.
Reply
#4
Not Solved
Ok, do you have the Attachments setup in your AdminCP like it's shown in the screenshot below?

[Image: afbd25251a7df9c738bdf7e9267bf6c5.png]
I'm Serpius and You're Not    ¯\_(ツ)_/¯
[Image: y3xr3cj5]
Reply
#5
Not Solved
yes I have it
Reply
#6
Not Solved
(08-06-2018, 01:00 AM)alstn13178 Wrote: yes I have it

One of the MyBB experts should be able to assist you. 

I am not certain what else it can be.
I'm Serpius and You're Not    ¯\_(ツ)_/¯
[Image: y3xr3cj5]
Reply
#7
Not Solved
Compared to imgur,
uploaded Images with mybb attachments are loaded every time when I click F5. Not cached


$img = $mybb->settings['uploadspath']."/".$attachment['attachname'];

$time_up = $attachment['dateuploaded'];
$etag=md5($time_up.$img);
$time=gmdate('r', $time_up);

header('Last-Modified: '.$time);
header("Cache-Control: must-revalidate");
header('Expires: '.$time);
header("Etag: ".$etag);

I seem to have found a way.
Attaching this header to image in attachment.php will cache it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)