Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6669327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:08:12+00:00 2026-05-26T03:08:12+00:00

We have two files in header of every web page – a ccs and

  • 0

We have two files in header of every web page – a ccs and a javascript file:

<script type="text/javascript" src="/js/scripts.js?1234"></script>
<link href="styles.css?2345" rel="stylesheet" type="text/css" />

Every time we modify a css/javascript file we increase the ?1234 parameter in the end of filename. Recently a member of the team proposed to replace this manual updating (that we have sometimes forgot to do) with PHP code that checks the file modification time itself:

<script type="text/javascript" src="/js/scripts.js?<?php echo filemtime('/js/scripts.js');?>"/>
<link href="styles.css?<?php echo filemtime('styles.css');?>" rel="stylesheet" type="text/css" />

The question is that how much slower (if at all) it makes the requests? Should we do it? We run our system in Linux server on Amazon EC2.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:08:12+00:00Added an answer on May 26, 2026 at 3:08 am

    Filetime is slow but using it 2 times in a webpage maybe ok. But I would cache the result and only update it sometime (with a conjob for example).

    Well if you are checking 1000 files, filemtime will actually DOUBLE
    the amount of time used if just reading the file with
    file_get_contents!

    -> http://ckon.wordpress.com/2008/09/16/filemtime-the-performance-killer/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I will have two files. One header.h file and second one is main.c file.
I have a bunch of CSS files that get loaded on every page (header,
I have two files client.php and server.php. The client file send a HTTP request
I have two files: domainList and config.cnf. The domainList file simply has a list
I have two files and the content is as follows: alt text http://img144.imageshack.us/img144/4423/screencapture2b.png alt
I have two files A - nodes_to_delete and B - nodes_to_keep . Each file
Hello ever one I have made a main function and two files one header
I have two header files A.h(include a pure virtual function) and B.h. A.h :
Static variable has file scope. Say I have two following files: file1.h file1.cpp file2.h
I have a class. I have made two seperate files, the header, and the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.