Alternatively, join us on Discord.

+-Recent Topics

Dynamically generated GIF scrolltext

Started by DarkestEx, December 20, 2015, 10:14:58 pm

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DJ Omnimaga

I assume it's because it's dynamically-generated? One other issue could be the file size, though, but in Darkest's case his avatar is under 300 KB.

Btw, try to not make your text too long if you ever use such avatar. Even 300 KB is a bit large for an avatar, especially on 3G, but it's tolerable. But smaller is better whenever possible. I wonder if adding the Walrii would make it larger?

c4ooo

Quote from: DJ Omnimaga on December 24, 2015, 07:39:43 am
I assume it's because it's dynamically-generated? One other issue could be the file size, though, but in Darkest's case his avatar is under 300 KB.

Yes but how does it know that? I would presume the browser just caches every thing except php files.
@DarkestEx

DarkestEx

Quote from: c4ooo on December 25, 2015, 01:07:09 am
Quote from: DJ Omnimaga on December 24, 2015, 07:39:43 am
I assume it's because it's dynamically-generated? One other issue could be the file size, though, but in Darkest's case his avatar is under 300 KB.

Yes but how does it know that? I would presume the browser just caches every thing except php files.
@DarkestEx

Well the PHP page generates the image every few hours or when its force refreshed.
The browser has no idea that the image is actually auto generated as the PHP makes it look just like a normal image. PHP files are (as long as the server works correctly) never sent to the actual visitor of the website or their browser. They get executed on the webserver.

c4ooo

sorry if i seem bothersome, but I still dont understand. Why wont the browser just chache the first image that was generated just like it would a static file? Or is the extension of that image literally .php?

Also, i was hoping your profile picture would go into negative numbers, but unfortunately it doesn't XD

DarkestEx

Quote from: c4ooo on January 01, 2016, 06:40:34 am
sorry if i seem bothersome, but I still dont understand. Why wont the browser just chache the first image that was generated just like it would a static file? Or is the extension of that image literally .php?

Also, i was hoping your profile picture would go into negative numbers, but unfortunately it doesn't XD

Well browsers do cache images on their own, but as many people visit this page, every time my avatar is downloaded by the browser from the internet, it produces a big page load on my side. Every time the image is loaded from the web, the php script I wrote is called. It checks if there is new content or if the image is for any reason outdated. If not, the last generated image is sent. If the image needs to be refreshed, the last image is deleted and a new one is generated and saves to disk.

Haha, I used abs in the first place but after new year I changed it to new, static slogan.

DJ Omnimaga

I always wondered how to make a php script or image on a web server force refresh every few minute or so or when it changed, because when I change the site logo or edit the theme, it can take months before users see the changes.

DarkestEx

Quote from: DJ Omnimaga on January 01, 2016, 10:10:44 pm
I always wondered how to make a php script or image on a web server force refresh every few minute or so or when it changed, because when I change the site logo or edit the theme, it can take months before users see the changes.

Doing that is very simple. For CSS, there are a few easy solutions too.

Powered by EzPortal