Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by JohnnyDoomo

  1. I'm using php code I got from StackOverload that looks like this: <?php // Some URL for testing $url = 'https://www.google.de/favicon.ico'; // Time to cache the files (here: 10 minutes) define('time_to_cache', 600); // Create a local file representation $local = './cache/' . urlencode($url); // Determine whether the local file is too old if (@filemtime($local) + time_to_cache < time()) { // Download a fresh copy copy ($url, $local); // Store headers in case we need them (see alternative below) file_put_contents($local . '.hdr', join($http_response_header, "\n")); } // Solution 1: Redirect to the local cache file header('Location: ' . urlencode($local)); exit(); // Alternative: Send headers and the actual file // Note that this might cause problems, e.g. due // to cache fields and the like. // Read and send headers foreach(file($local . '.hdr') as $line) header($line); // Read and send the actual file readfile($local); ?> I've remarked out the "solution 1" lines, because that method doesn't work at all on my server. The alternative works, except for an https problem. I'm loading a bunch of images from 3rd party sites. My site is only https, and I want to keep all local images using https. I have lazyloading js applied to all images that load on the page, and when I use the above php, as I scroll down my page, my browser https lock will turn to unsecure. So I can assume, that lots of the images are loading properly from https, and then suddenly, it loads an image from http instead of https. So for some reason, the above php is not keeping my https, despite that the script looks to only call the image from my local location. I'm fairly new to learning php, but am I missing something here? From what I can see from the "readfile" line, all images should be shown from my cached area, which I've already stated as https, and have tried both "//" and specifically hardcoding "https" into the img src, but I still get these problems, where as I scroll down the page, the browser https secure lock will change to the mixed content, indicating that the browser has just loaded something NOT from https. Can anybody help me with what I need to add, so that the above code either keeps my secure protocol or doesn't try to load the image if it's not from https? Any help would be appreciated!
  2. I created a new homepage for my network of sites I run. I tried to go for a simple and clean look. The pages themselves function how I'd like, but I'm unsure if the menu system is easy to understand or not. I even added a time limited message on the front page of the site indicating that the logo was clickable, but purposely left it off of other sub-pages to try and keep the design as clean as possible. Check it out, let me know what you think. http://ctenetwork.com
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.