Jump to content

Search the Community

Showing results for tags 'cache'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 7 results

  1. Securing my upload folder “upl” The upl folder is used to store anything that is uploaded by the user for their needs that is not a part of the back end, as such all content in this folder is subject to being locked down and and supplied after checking credentials. The upl folder has an .htaccess file that locks down all remote access. order deny,allow deny from all When something is needed from this directory we jump that wall with the help of apache after credentials are verified. I think this is straight forward so far. For images something like; <img src=”downloader.php?app=1&id=20&type=thumb”> For files something like; <a href=”downloader.php?app=1&id=20&type=file&fileid=1212”> After we check creds, we use similar to below to get data from that locked down folder. $size = filesize($file); header ( 'Content-Description: File Transfer' ); header("Content-Type: application/force-download"); header ( 'Content-Type: application/octet-stream' ); header ( "Content-Disposition: attachment; filename=\"".basename($file)."\""); header ( 'Expires: 0' ); header ( 'Cache-Control: must-revalidate' ); header ( 'Pragma: public' ); header ( 'Content-Length: ' . filesize ( $file ) ); ob_clean(); flush(); readfile ( $file ); exit(); seems to work pretty swimmingly for the most part. My problem is (or at lease a mild nuisance) is that it seems that these images loaded in this manner are not subject to the cache system of a browser? It looks like they reload every time a page is visited. Is there a way around this?
  2. I am using php require to input a page of code. I am including (require) that file several times within the page. I am guessing that it executes the file every time, and does not save any page loading time, and in fact probably slowing it down because it has to make the request every time. Just wanted an expert to confirm or deny my educated guess. Would it be the same if it were including an html file instead of a php file? <?php require ("$base_path/main_page_rotation/content4.php"); ?>
  3. What's the best way to cache things on the server? I've found some SetEnv things but this all seems to be a single key/value. I'd like to cache an array of things that I can access later. Right now it's cached in $_SESSION which is fine, but still there's overhead on every first-time visitor to a site. Is there a way to add something to $_SERVER or elsewhere that ALL visitors to a website will ultimately be able to access? I guess I want something like web.config in C#, where the first time a page is visited, the "app starts", as it were, and those things are now in cache on the server. What's the best way to do this?
  4. Hi I just have a question about the caching code below. Should the date function be in the filename if I want to cache the file for several days? Or if the date changes will a new file be created and used instead of the the previous cache file. Is that not even used since my if statement checks for the file modification time? Thanks for the help in understanding this. $cachefile = 'cache/cached/'.$id . date('M-d-Y').'.php'; $cachetime = 172800; // Check if the cached file is still fresh. If it is, serve it up and exit. if (file_exists($cachefile) && time() - $cachetime < filemtime($cachefile)) { include($cachefile); exit; } ob_start(); {HTML TO CACHE} $fp = fopen($cachefile, 'w'); fwrite($fp, ob_get_contents()); fclose($fp); // finally send browser output ob_end_flush(); I basically want to cache a file for 2-3 days.
  5. I have a website in which I use php, and at one point I tried some MySQL on there and, unfortunately, MySQL seems to be my Achilles' heel; It's less complicated by far than most languages, yet I still can't seem to wrap my head around it. There is no MySQL anywhere in any file on my local system, which is the only place the site exists so far. I will paste the code if necessary. My main question is, has anyone experienced something like this? I read about the "ghost" SQL (Jesus, Destiny, etc.) but that seems more of a prank or an "act of God" (as defined by some insurance companies) rather than a cache or browser/ source issue... Right? I am relatively new to php in depth, but have much experience using it simply, such as with including files or other light tasks like math or small "game elements" (for games which otherwise do not exist
  6. I have a website where I allow people to submit a .pdf file and it is then displayed in an iframe or in a pdf object in a div. The names of the files always stay the same, and are uploaded to a specific folder. Problem is- when they upload a new .pdf file....the browser always displays the old .pdf file. Deleting temp files- doesn't change. <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> does not work Is there a way to make sure that the current and updated pdf file gets served to the browser and it displays it? Any suggestions would help. Andy
  7. Hi All I have a site that is takinga bunch of feeds from other sites, normalising the data into a product file. I also have a "Google" like search engine that a user can use to searh this data and get desired results. I have nearly 1m products and it takes 1 user only approximately 10 seconds to search the data even though its thoroughly indexed. I heard putting the data in cache would be far quicker. Is this true? The size of the data is just under 600mb so i have plenty of RAM. If this is true can someone please point me in the right direction to upload it in the cache and search on it. Many thanks
×
×
  • 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.