Method and apparatus for automatically optimizing the loading of images in a cloud-based proxy service
First Claim
1. A method for automatically optimizing the loading of images of a web page, the method comprising:
- receiving a request for the web page that originates from a client network application of a client device, the web page including a plurality of references to a plurality of images respectively;
retrieving the requested web page, wherein the requested web page includes code that includes a plurality of image tags for the plurality of images respectively;
modifying the code of the retrieved web page such that the client network application will not, for each one of the plurality of images, request that image until the location where that image is to be displayed is within a viewport of the client network application or within a defined distance from the viewport of the client network application, wherein modifying the code of the retrieved web page includes the following;
modifying each of the plurality of image tags such that the client network application will not initially request those images, andadding a set of one or more client-side scripts or one or more references to one or more client-side scripts that, when executed by the client network application, cause the client network application to perform the following;
determine a size of the viewport, andmake a request for only those of the plurality of images whose corresponding image placeholders are within the viewport of the client network application or within the defined distance from the viewport of the client network application by restoring those modified image tags, wherein each request is to indicate a requested image size based on the determined size of the viewport and a set of one or more image dimensions as governed by the code of the web page; and
transmitting the modified web page to the client device.
1 Assignment
0 Petitions
Accused Products
Abstract
A request is received at a proxy server for a web page, the request originating from a client network application of a client device. The requested web page includes multiple references to multiple images. The proxy server retrieves the requested web page. The proxy server modifies code of the retrieved web page such that the client network application will not, for each one of images, request that image until the location where that image is to be displayed is within a viewport of the client network application or within a defined distance from the viewport of the client network application. The proxy server transmits the modified web page to the client device.
77 Citations
16 Claims
-
1. A method for automatically optimizing the loading of images of a web page, the method comprising:
-
receiving a request for the web page that originates from a client network application of a client device, the web page including a plurality of references to a plurality of images respectively; retrieving the requested web page, wherein the requested web page includes code that includes a plurality of image tags for the plurality of images respectively; modifying the code of the retrieved web page such that the client network application will not, for each one of the plurality of images, request that image until the location where that image is to be displayed is within a viewport of the client network application or within a defined distance from the viewport of the client network application, wherein modifying the code of the retrieved web page includes the following; modifying each of the plurality of image tags such that the client network application will not initially request those images, and adding a set of one or more client-side scripts or one or more references to one or more client-side scripts that, when executed by the client network application, cause the client network application to perform the following; determine a size of the viewport, and make a request for only those of the plurality of images whose corresponding image placeholders are within the viewport of the client network application or within the defined distance from the viewport of the client network application by restoring those modified image tags, wherein each request is to indicate a requested image size based on the determined size of the viewport and a set of one or more image dimensions as governed by the code of the web page; and transmitting the modified web page to the client device. - View Dependent Claims (2, 3, 4)
-
-
5. A method in a client device for automatically optimizing the loading of images of a web page while rendering the web page, the method comprising:
-
receiving a web page, wherein the web page includes a plurality of image tags that refer to a plurality of images respectively and further includes a set of one or more client-side scripts; determining, through execution of at least one of the set of one or more client-side scripts, a size of a viewport of a client network application of the client device; for each of the plurality of image tags, determining a location in the web page where the corresponding image is to be displayed, wherein each of the plurality of image tags has been modified such that the client network application will not request the corresponding image until the determined display location for those corresponding images are within the viewport or within the defined distance from the viewport; and for each and only those of the plurality of image tags whose determined location in the web page where the corresponding image is to be displayed is within the viewport or within a defined distance from the viewport, performing the following; determining, through execution of at least one of the set of one or more client-side scripts, a set of one or more dimensions that the image is to be displayed as governed by code of the web page, transmitting a request for that image that includes an indication of a requested size of that image based on the determined size of the viewport and the set of dimensions, receiving that image, and displaying that image. - View Dependent Claims (6, 7, 8)
-
-
9. A non-transitory machine-readable storage medium that provides instructions that, when executed by a processor, cause the processor to perform operations comprising:
-
receiving a request for a web page that originates from a client network application of a client device, the web page including a plurality of references to a plurality of images respectively; retrieving the requested web page, wherein the requested web page includes code that includes a plurality of image tags for the plurality of images respectively; modifying the code of the retrieved web page such that the client network application will not, for each one of the plurality of images, request that image until the location where that image is to be displayed is within a viewport of the client network application or within a defined distance from the viewport of the client network application, wherein modifying the code of the retrieved web page includes the following; modifying each of the plurality of image tags such that the client network application will not initially request those images, and adding a set of one or more client-side scripts or one or more references to one or more client-side scripts that, when executed by the client network application, cause the client network application to perform the following; determine a size of the viewport, and make a request for only those of the plurality of images whose corresponding image placeholders are within the viewport of the client network application or within the defined distance from the viewport of the client network application by restoring those modified image tags, wherein each request is to indicate a requested image size based on the determined size of the viewport and a set of one or more image dimensions as governed by the code of the web page; and transmitting the modified web page to the client device. - View Dependent Claims (10, 11, 12)
-
-
13. A non-transitory machine-readable storage medium that provides instructions that, when executed by a processor, cause the processor to perform operations comprising:
-
receiving a web page, wherein the web page includes a plurality of image tags that refer to a plurality of images respectively and further includes a set of one or more client-side scripts; determining, through execution of at least one of the set of one or more client-side scripts, a size of a viewport of a client network application of the client device; for each of the plurality of image tags, determining a location in the web page where the corresponding image is to be displayed, wherein each of the plurality of image tags has been modified such that the client network application will not request the corresponding image until the determined display location for those corresponding images are within the viewport or within the defined distance from the viewport; and for each and only those of the plurality of image tags whose determined location in the web page where the corresponding image is to be displayed is within the viewport or within a defined distance from the viewport, performing the following; determining, through execution of at least one of the set of one or more client-side scripts, a set of one or more dimensions that the image is to be displayed as governed by code of the web page, transmitting a request for that image that includes an indication of a requested size of that image based on the determined size of the viewport and the set of dimensions, receiving that image, and displaying that image. - View Dependent Claims (14, 15, 16)
-
Specification