vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   "CCS.php" getting slammed.... (https://vborg.vbsupport.ru/showthread.php?t=236678)

1GTurn 02-23-2010 12:34 PM

"CCS.php" getting slammed....
 
Don't know if this is a bug or something I might have wrong. Currently the ccs.php file located under the root directory is getting hit over 20,000 times every 24hours. We only have about 100 users and have had no more than 33 people on line at one time. Seems an awful lot for not that many users. Anything I should check for or can provide that might solve this issue. I'm running 4.0.2.

Let me know if anymore information is needed in order to help figure this out.


Thank you

--------------- Added [DATE]1266937188[/DATE] at [TIME]1266937188[/TIME] ---------------

Don't know if this helps but under Style & Language Settings the "Store CSS Stylesheets as Files" is currently no.

--------------- Added [DATE]1266940604[/DATE] at [TIME]1266940604[/TIME] ---------------

Any help on this? Do I need to post this somewhere else for support?

--------------- Added [DATE]1266944294[/DATE] at [TIME]1266944294[/TIME] ---------------

PHP Code:

<?php

/*======================================================================*\

|| #################################################################### ||

|| # vBulletin 4.0.2 - Licence Number VBF954030F

|| # ---------------------------------------------------------------- # ||

|| # Copyright ?2000-2010 vBulletin Solutions Inc. All Rights Reserved. ||

|| # This file may not be redistributed in whole or significant part. # ||

|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||

|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||

|| #################################################################### ||

\*======================================================================*/



// ####################### SET PHP ENVIRONMENT ###########################

error_reporting(E_ALL & ~E_NOTICE);



// #################### DEFINE IMPORTANT CONSTANTS #######################

define('THIS_SCRIPT''css');

define('CSRF_PROTECTION'true);

define('NOPMPOPUP'1);

define('NOCOOKIES'1);

define('NONOTICES'1);

define('NOHEADER'1);

define('NOSHUTDOWNFUNC'1);

define('LOCATION_BYPASS'1);



define('NOCHECKSTATE'1);

define('SKIP_SESSIONCREATE'1);



// Immediately send back the 304 Not Modified header if this css is cached, don't load global.php

if ((!empty($_SERVER['HTTP_IF_MODIFIED_SINCE']) OR !empty($_SERVER['HTTP_IF_NONE_MATCH'])))

{

    
$sapi_name php_sapi_name();

    if (
$sapi_name == 'cgi' OR $sapi_name == 'cgi-fcgi')

    {

        
header('Status: 304 Not Modified');

    }

    else

    {

        
header('HTTP/1.1 304 Not Modified');

    }

    
// remove the content-type and X-Powered headers to emulate a 304 Not Modified response as close as possible

    
header('Content-Type:');

    
header('X-Powered-By:');

    exit;

}



// ################### PRE-CACHE TEMPLATES AND DATA ######################

// get special phrase groups

$phrasegroups = array();



// get special data templates from the datastore

$specialtemplates = array();



// pre-cache templates used by all actions  - build

preg_match_all('#([a-z0-9_\-]+\.css)#i'$_REQUEST['sheet'], $matches);

if (
$matches[1])

{

    foreach (
$matches[1] AS $cssfile)

    {

        
$globaltemplates[] = $cssfile;

    }

}

else

{

    
$globaltemplates = array();

}



// pre-cache templates used by specific actions

$actiontemplates = array();



// ######################### REQUIRE BACK-END ############################

require_once('./global.php');



// #######################################################################

// ######################## START MAIN SCRIPT ############################

// #######################################################################



header('Content-Type: text/css');



(
$hook vBulletinHook::fetch_hook('css_start')) ? eval($hook) : false;



if (empty(
$matches[1]))

{

    echo 
"/* Unable to find css sheet */";

}

else

{

    
//        Note that the css publishing mechanism relies on the fact that

    //        there isn't any user specific data passed to the css templates.



    
$templates '';

    
$count 0;

    foreach (
$matches[1] AS $template)

    {

        if (
$count 0)

        {

            
$templates .= "\r\n\r\n";

        }

        
$templater vB_Template::create($template);

        
$template $templater->render(true);

        if (
$count 0)

        {

            
$template preg_replace("#@charset .*#i"""$template);

        }

        
$templates .= $template;

        
$count++;

    }



    
// TODO - Remove this

    //temporary -- allows me to fix the stylevars without destroying everybody else's work.

    // commented-out by chris: 01/14/2010

    //$templates = str_replace('pxpx', 'px', $templates);



    
header('Cache-control: max-age=31536000, private');

    
header('Expires: ' gmdate("D, d M Y H:i:s"TIMENOW 31536000) . ' GMT');

    
header('Last-Modified: ' gmdate('D, d M Y H:i:s'$style['dateline']) . ' GMT');



    echo 
$templates;

}



/*======================================================================*\

|| ####################################################################

|| # Downloaded: 16:41, Fri Feb 19th 2010

|| # CVS: $RCSfile$ - $Revision: 30573 $

|| ####################################################################

\*======================================================================*/

Here is the CCS.php file in question if it helps.

KW802 02-24-2010 03:13 PM

Quote:

Originally Posted by 1GTurn (Post 1989574)
Don't know if this helps but under Style & Language Settings the "Store CSS Stylesheets as Files" is currently no.

When that setting is set to "No" then your CSS files are served by the css.php script. If you set that to "Yes" then your CSS files are saved to the /clientscript folder and are served from there instead of the css.php script. For a number of reasons I always prefer storing the CSS as files but your needs may vary.

Quote:

Originally Posted by 1GTurn (Post 1989574)
Any help on this? Do I need to post this somewhere else for support?

Official vB support is available at vBulletin.com -- here it is just peer-to-peer help.


All times are GMT. The time now is 11:49 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01062 seconds
  • Memory Usage 1,757KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete