Giter VIP home page Giter VIP logo

requestreduce's Introduction

#RequestReduce RequestReduce Makes your website faster - sometimes much faster - with almost no effort

##Getting started

  1. If you have [Nuget] (http://docs.nuget.org/docs/start-here/installing-nuget), simply enter Install-Package RequestReduce in the Package Manager Console and skip steps two and three, otherwise download the latest RequestReduce version [here] (http://www.requestreduce.com/)
  2. Extract the contents of the downloaded zip and copy RequestReduce.dll and optipng.exe to your website's bin directory
  3. If you want to sync multiple servers with SqlServer copy te DLLs in RequestReduce.SqlServer to your bin directory
  4. If you have Less, Sass or Coffee scripts, copy the DLLs from RequestReduce.SassLessCoffee to your bin to compile these to CSS and Javascript
  5. Add the RequestReduceModule to your web.config or using the IIS GUI.

Assuming you are using IIS 7, you would add it by ensuring that your web.config's system.webServer/modules element contains an add element as follows:

<system.web>
  <httpModules>
    <add name="RequestReduce" type="RequestReduce.Module.RequestReduceModule, RequestReduce" />
  </httpModules>
</system.web>
<system.webServer>
  <validation validateIntegratedModeConfiguration="false"/>  
	<modules>
      <add name="RequestReduce" type="RequestReduce.Module.RequestReduceModule, RequestReduce" />
	</modules>
</system.webServer>

All background images you want to sprite [must have an explicit width in their css class] (http://github.com/mwrock/RequestReduce/wiki/Can-I-make-changes-to-my-CSS-classes-to-optimize-RequestReduce-spriting%3F). Otherwise RequestReduce cannot guarantee that the background positions it injects will not cause adjacent sprites to bleed into a background image's view port. Also, RequestReduce will ignore repeating images so make sure to mark the image no-repeat if it is not a repeating image.

##Troubleshooting If RequestReduce does not appear to be doing anything, check out this [troubleshooting wiki] (https://github.com/mwrock/RequestReduce/wiki/RequestReduce-is-not-working.-I-don%27t-see-any-spriting-or-minification.-How-can-I-troubleshoot-this%3F) which provides several scenarios, options and debugging tips for figuring out why your content may not be being reduced. Also check the [list of wiki support pages] (https://github.com/mwrock/RequestReduce/wiki) which provides documentation addressing several topics to help you optimize RequestReduce and explain how RequestReduce works.

##Requirements

  • The Core RequestReduce Dll is Compatible with Framework versions 3.5 and 4.0
  • Sql Server integration and Less, Sass and Coffee compilation require .net 4.0
  • Standard Features are Medium Trust compliant
  • The identity that your asp.net worker process runs under must have write access to your web root directory for creating sprite and css files

##What's Next? There are a ton of features I intend to add in order to make web performance optimizations just happen as part of installing Request Reduce. Here is what's at the top of the backlog:

  • Support defered javascript loading
  • Leverege CSS 3 to allow RequestReduce to sprite more images without any need for css modifications for supporting browsers
  • Options to sprite foreground images
  • Provide a command line utility for incorporating RequestReduce optimizations into a build task

##Resources

##Acknowledgements RequestReduce uses the following excellent OSS and other Free projects:

###RequestReduce Core

###RequestReduce.SqlServer

###RequestReduce.SassLessCoffee

###RequestReduce Internal Code (testing and building)

##License Licenced under [Apache 2.0] (http://www.apache.org/licenses/LICENSE-2.0)

requestreduce's People

Contributors

bizzarry avatar david-poirier avatar madsstorm avatar matthawley avatar mmanela avatar mwrock avatar orand avatar orthographic-pedant avatar purekrome avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

requestreduce's Issues

Disabling sprite

Hello Sir,
The project which I am currently working on already have singe image containing sprites. Is there a option to disable sprite but still continue with css minification. Please suggest?
Thanks and Regards!
Vishal

Add config option to disable request filtering

It would be convenient to add a web.config option to turn on or off request reduces filtering. In a dev environment when making many changes to CSS it is nice not to have them constantly cached.

Thanks,
-Matt

Add Compression

Ideally Users will use IIS to handle compression since that probably provides slightly better perf and is less likely to break downstream modules. However, in the event that users are in an environment preventing them from adjusting IIS compression options, might be nice to provide a config option that will compress the output of scripts and css. It should be off by default.

Decouple spriting functionality to a separate project

I have been asked by a few people for this functionality on its own and in a format that lends itself more to a build task. This will be a library offered with a commandline wrapper. It should have no dependency or involvement in the persistence, minify/merge, or filtering functionalities.

Periodically check for new content

Currently we only fetch new content upon a URL change. This makes content refreshes a bit painful forcing the use of explicit flushing if the change does not result in a url change. We are also forced to ignore near future expiring javascript. If we routinely checked and refreshed content, we could merge/minify near future javascript.

As we process content, persist the original urls and caching headers/etags. If not busy processing content, issue head requests for cached content every N minutes and refresh if content has been changed.

Review filter code for any low hanging perf gains

With the js parsing, the filter is doing quite a bit more. There may be some "micro" optimizations I can make to the char by char matching that may not be quite so micro given that each byte is compared.

Doesn't always add <script/> and <link /> tags

Request Reduce does not always remove the original scripts and css links and add the RequestReduceContent path.

Sometimes it runs and only the css appears reduced, sometimes it has all been reduced and sometimes nothing is reduced - even though new files are being created within RequestReduceContent.

Using MVC3/.NET4 on IIS7.5 with no changes to web.config (setup using NuGet).

Conditional HTML Comments

Request reduce does not take into account conditional comments such as:

When Request Reduce runs, it places the minifed file within the conditional tags meaning no browsers other than pre IE9 will see any of the javascript.

Support CSS / JS Alternates

Like LESS, SASS, CoffeeScript.

It would likely be easy to start with LESS, since the library already exists (dotless)

Ability to expire reduction files

Create route /rrcontent/key/flush and /rrcontent/flush
Take comma separated list of users or annonymous and only give them access to this route
DB: Mark db record as expired and remove from repo dictionary. GetSavedUrls will ignore these files.
File: Remove from repo dictinary. Copy files to an archive directory. When module cant find file, fallback to archive directory

Images not sprited (ASP.NET MVC3)

Hello,

After installing RequestReduce via NuGet and making sure my CSS matches how the wiki wants it, it does not appear to fully work.

My CSS example:

.logo
{
float:left;
width:234px;
height:140px;
background: url('/Content/Images/logo.png');
}

What RequestReduce outputs in its CSS file (that replaces my two):

.logo{float:left;width:234px;height:140px;background:url('http://localhost:9020/Content/Images/logo.png')

Is this an issue with my CSS or just a bug?

Separate Response Filter into a separate project

I now had need for this code in a separate project and forsee a need in one other upcoming sprint. I think there is some value in providing this as its own OSS offering. It will need to be a bit more extendable. Currently it is pretty baked into the specific tokens it searches for.

Limit Failed Reductions

If a reduction fails (typically due to a 404 on an image. RR will attempt to reduce on every request. I should maintain an in memory counter that the queue checks and if it is over (5?) then ignore the queued item.

Fails to build on AppHarbor

Hello,

Deploying an ASP.NET MVC 3 application to AppHarbor with RequestReduce installed (via nuget) fails. This is down to the path used in the proj file:

xcopy /s /y "D:\temp\4bn4fdml.okq\input\packages\RequestReduce.0.9.221\pngoptimization*.exe" "D:\temp\4bn4fdml.okq\output" Invalid drive specification

Is the output from AppHarbor about the failure. Removing the xcopy line from the project file solves the issue but is a temporary fix.

Provide database backed files

Necessary for multi server environment.

Table RequestReduceFiles:
id: guid hashed from original hash + file
content: file bytes
originalCssName
originalImageName
LastUpdated

Module will detect if request is in RRContent directory and then look to local file. If not on disk, pull from db and cache to disk.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.